Skip to content

Commit

Permalink
Update logic v2
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-baillargeon committed Oct 28, 2024
1 parent 78f4bbe commit a421664
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions anta/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,16 +366,16 @@ def test(self) -> None:
for ntp_server in self.inputs.ntp_servers:
server_address = str(ntp_server.server_address)

# Collecting the expected NTP peer details.
expected_peer_details = {"condition": "sys.peer" if ntp_server.preferred else "candidate", "stratum": ntp_server.stratum}

# Check if NTP server details exists.
matching_peer = next((peer for peer in peer_details if server_address in peer), None)

if not matching_peer:
failures += f"NTP peer {server_address} is not configured.\n"
continue

# Collecting the expected NTP peer details.
expected_peer_details = {"condition": "sys.peer" if ntp_server.preferred else "candidate", "stratum": ntp_server.stratum}

# Collecting the actual NTP peer details.
actual_peer_details = {
"condition": get_value(peer_details[matching_peer], "condition"),
Expand Down

0 comments on commit a421664

Please sign in to comment.