Skip to content

Commit

Permalink
Delete communication failure test
Browse files Browse the repository at this point in the history
  • Loading branch information
Owain Charlon authored and hezanathos committed May 27, 2022
1 parent 4c1b772 commit 0ba478d
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Script used to delete duplicates with 'server_update_comm_fail' status"""
"""Script used to delete duplicates"""

import os
from configparser import ConfigParser
Expand All @@ -25,11 +25,9 @@ def find_duplicates(servers):
for server in sorted(servers, key=lambda x: (x.hostname is None, x.hostname)):
if server.hostname == duplicate.hostname and server.hostname is not None:
if server.last_communication is None or duplicate.last_communication > server.last_communication:
if server.status == 'server_update_comm_fail':
duplicates.append(server)
duplicates.append(server)
else:
if duplicate.status == 'server_update_comm_fail':
duplicates.append(duplicate)
duplicates.append(duplicate)
duplicate = server
else:
duplicate = server
Expand Down

0 comments on commit 0ba478d

Please sign in to comment.