From 746b3d4c848cc18bce5fb032ea9ce698bff54700 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 4 Jul 2026 08:10:01 +1000 Subject: [PATCH] PLG: sync PUSH devices fix #1698 --- front/plugins/sync/sync.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/front/plugins/sync/sync.py b/front/plugins/sync/sync.py index 61c25578..9ccb5763 100755 --- a/front/plugins/sync/sync.py +++ b/front/plugins/sync/sync.py @@ -23,6 +23,7 @@ from messaging.in_app import write_notification # noqa: E402 [flake8 lint suppr import conf # noqa: E402 [flake8 lint suppression] from pytz import timezone # noqa: E402 [flake8 lint suppression] from database import get_temp_db_connection # noqa: E402 [flake8 lint suppression] +from config_paths import API_PATH # noqa: E402 [flake8 lint suppression] # Make sure the TIMEZONE for logging is correct conf.tz = timezone(get_setting_value('TIMEZONE')) @@ -105,9 +106,7 @@ def main(): # PUSHING/SENDING devices if send_devices: - - api_path = os.environ.get('NETALERTX_API', '/tmp/api') - file_path = f"{api_path}/table_devices.json" + file_path = f"{API_PATH}/table_devices.json" pref = 'SYNC' if os.path.exists(file_path): @@ -118,7 +117,7 @@ def main(): mylog('verbose', [f'[{pluginName}] Sending file_content: "{file_content}"']) send_data(api_token, file_content, encryption_key, file_path, node_name, pref, hub_url) else: - mylog('none', [f'[{pluginName}] ERROR Could not open: "{file_content}"']) + mylog('none', [f'[{pluginName}] ERROR Could not open: "{file_path}"']) else: mylog('verbose', [f'[{pluginName}] SYNC_hub_url not defined, skipping posting "Devices" data']) else: