From 309c1fe1a8710984f57cc652c7f06571b9b8d222 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Fri, 2 Jun 2023 08:22:08 +0200 Subject: [PATCH] Ignore the accepts and rejects columns when calculating the diff between the two databases. Those fields may always differ. --- src/cnaas_nac/tools/db_replicator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cnaas_nac/tools/db_replicator.py b/src/cnaas_nac/tools/db_replicator.py index 072a9b3..22781ae 100644 --- a/src/cnaas_nac/tools/db_replicator.py +++ b/src/cnaas_nac/tools/db_replicator.py @@ -24,11 +24,19 @@ def diff_rows(list_a: list, list_b: list) -> list: del x['id'] if 'authdate' in x: del x['authdate'] + if 'accepts' in x: + del x['accepts'] + if 'rejects' in x: + del x['rejects'] for x in list_b: if 'id' in x: del x['id'] if 'authdate' in x: del x['authdate'] + if 'accepts' in x: + del x['accepts'] + if 'rejects' in x: + del x['rejects'] for item in list_a: if item not in list_b: