From 086cd303557d3537fed54a62d6b61a1dfb69aef3 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sun, 5 Oct 2025 14:36:03 +1100 Subject: [PATCH] Prevent Internet root node flipping w/ SYNC plugin enabled #1207 Signed-off-by: jokob-sk --- front/plugins/sync/sync.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front/plugins/sync/sync.py b/front/plugins/sync/sync.py index 59ecc13d..f6b328ac 100755 --- a/front/plugins/sync/sync.py +++ b/front/plugins/sync/sync.py @@ -178,7 +178,7 @@ def main(): if file_name != 'last_result.log': mylog('verbose', [f'[{pluginName}] Processing: "{file_name}"']) - # make sure the file has teh correct name (e.g last_result.encoded.Node_1.1.log) to skip any otehr plugin files + # make sure the file has the correct name (e.g last_result.encoded.Node_1.1.log) to skip any otehr plugin files if len(file_name.split('.')) > 2: # Store e.g. Node_1 from last_result.encoded.Node_1.1.log syncHubNodeName = file_name.split('.')[1] @@ -210,9 +210,10 @@ def main(): existing_mac_addresses = set(row[0] for row in cursor.fetchall()) - # insert devices into the lats_result.log to manage state + # insert devices into the last_result.log and thus CurrentScan table to manage state for device in device_data: - if device['devPresentLastScan'] == 1: + # only insert devices taht were online and skip the root node to prevent IP flipping on the hub + if device['devPresentLastScan'] == 1 and str(device['devMac']).lower() != 'internet': plugin_objects.add_object( primaryId = device['devMac'], secondaryId = device['devLastIP'],