mirror of
https://bitbucket.org/anguist/ntpa
synced 2026-10-01 07:08:04 +00:00
Removed dependency to org id
This commit is contained in:
@@ -65,12 +65,16 @@ namespace Ntp.Analyzer.Process.Description
|
||||
foreach (NtpConfEntry entry in DataFace.Instance.NtpConfigCache[config.ConfigFile])
|
||||
{
|
||||
IEnumerable<Peer> peers = DataFace.Instance.Peers.Where(p => p.Ip == entry.Address.ToString());
|
||||
|
||||
if (peers.Count() == 0)
|
||||
{
|
||||
Log.WriteLine("Peer not found in database: " + entry.Name, Severity.Warn);
|
||||
continue;
|
||||
}
|
||||
else if (peers.Count() > 1)
|
||||
{
|
||||
Log.WriteLine("Ambiguous peer IP. Multiple occurrence found in database: " + entry.Name, Severity.Warn);
|
||||
continue;
|
||||
}
|
||||
|
||||
Peer peer = peers.Single();
|
||||
|
||||
|
||||
@@ -70,13 +70,17 @@ namespace Ntp.Analyzer.Process.Description
|
||||
{
|
||||
foreach (NtpConfEntry entry in DataFace.Instance.NtpConfigCache[config.ConfigFile])
|
||||
{
|
||||
IEnumerable<Peer> peers = DataFace.Instance.Peers.Where(p => p.OrgId == entry.OrgId.Value);
|
||||
|
||||
IEnumerable<Peer> peers = DataFace.Instance.Peers.Where(p => p.Ip == entry.Address.ToString());
|
||||
if (peers.Count() == 0)
|
||||
{
|
||||
Log.WriteLine("Peer not found in database: " + entry.Name, Severity.Warn);
|
||||
continue;
|
||||
}
|
||||
else if (peers.Count() > 1)
|
||||
{
|
||||
Log.WriteLine("Ambiguous peer IP. Multiple occurrence found in database: " + entry.Name, Severity.Warn);
|
||||
continue;
|
||||
}
|
||||
|
||||
Peer peer = peers.Single();
|
||||
|
||||
|
||||
@@ -71,8 +71,7 @@ namespace Ntp.Analyzer.Process.Description
|
||||
|
||||
foreach (NtpConfEntry entry in DataFace.Instance.NtpConfigCache[page.ConfigFile])
|
||||
{
|
||||
IEnumerable<Peer> peers = DataFace.Instance.Peers.Where(p => p.OrgId == entry.OrgId.Value);
|
||||
|
||||
IEnumerable<Peer> peers = DataFace.Instance.Peers.Where(p => p.Ip == entry.Address.ToString());
|
||||
if (peers.Count() == 0)
|
||||
{
|
||||
Log.WriteLine("Peer not found in database. Creating peer: " + entry.Name, Severity.Warn);
|
||||
@@ -85,7 +84,7 @@ namespace Ntp.Analyzer.Process.Description
|
||||
}
|
||||
else if (peers.Count() > 1)
|
||||
{
|
||||
Log.WriteLine("Ambiguous peer name. Multiple occurrence found in database: " + entry.Name, Severity.Warn);
|
||||
Log.WriteLine("Ambiguous peer IP. Multiple occurrence found in database: " + entry.Name, Severity.Warn);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user