From 0ba478db6eb34ab9b3bc9a62c5aefaed6da34c17 Mon Sep 17 00:00:00 2001 From: Owain Charlon Date: Fri, 27 May 2022 08:34:32 +0000 Subject: [PATCH] Delete communication failure test --- ...tes_communication_failure.py => cleanup_duplicates.py} | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename examples/{cleanup_duplicates_communication_failure.py => cleanup_duplicates.py} (86%) diff --git a/examples/cleanup_duplicates_communication_failure.py b/examples/cleanup_duplicates.py similarity index 86% rename from examples/cleanup_duplicates_communication_failure.py rename to examples/cleanup_duplicates.py index 6aab069..a5c21f6 100644 --- a/examples/cleanup_duplicates_communication_failure.py +++ b/examples/cleanup_duplicates.py @@ -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 @@ -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