From 2db510717f1db94166497e87d713ea6f0115c974 Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Sun, 10 May 2020 19:42:43 +0200 Subject: [PATCH] added hostname to some relevant task status strings --- inventory_provider/tasks/worker.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py index bab1b31d..6c965ae9 100644 --- a/inventory_provider/tasks/worker.py +++ b/inventory_provider/tasks/worker.py @@ -471,7 +471,7 @@ def reload_router_config(self, hostname): state=states.STARTED, meta={ 'hostname': hostname, - 'message': 'loading router netconf data' + 'message': f'loading netconf data for {hostname}' }) # get the timestamp for the current netconf data @@ -495,8 +495,9 @@ def reload_router_config(self, hostname): assert new_netconf_timestamp, \ 'no timestamp available for new netconf data' if new_netconf_timestamp == current_netconf_timestamp: - logger.debug('no netconf change timestamp change, aborting') - return self.success(f'no change (timestamp not updated)') + msg = f'no timestamp change for {hostname} netconf data' + logger.debug(msg) + return self.success(msg) # clear cached classifier responses for this router, and # refresh peering data @@ -504,7 +505,7 @@ def reload_router_config(self, hostname): state=states.STARTED, meta={ 'hostname': hostname, - 'message': 'refreshing peers & clearing cache' + 'message': f'refreshing peers & clearing cache for {hostname}' }) refresh_ix_public_peers(hostname, netconf_doc) refresh_vpn_rr_peers(hostname, netconf_doc) @@ -516,19 +517,20 @@ def reload_router_config(self, hostname): community = juniper.snmp_community_string(netconf_doc) if not community: raise InventoryTaskError( - 'error extracting community string for %r' % hostname) + f'error extracting community string for {hostname}') else: self.update_state( state=states.STARTED, meta={ 'hostname': hostname, - 'message': 'refreshing snmp interface indexes' + 'message': f'refreshing snmp interface indexes for {hostname}' }) + # load snmp data, in this thread snmp_refresh_interfaces.apply(args=[hostname, community]) clear_cached_classifier_responses(None) - return self.success(f'updated config for {hostname}') + return self.success(f'updated configuration for {hostname}') def _erase_next_db(config): -- GitLab