Skip to content
Snippets Groups Projects
Commit 909262b4 authored by Erik Reid's avatar Erik Reid
Browse files

put task name in state meta in parent class

parent e09fd7d4
No related branches found
No related tags found
No related merge requests found
...@@ -67,8 +67,10 @@ class InventoryTask(Task): ...@@ -67,8 +67,10 @@ class InventoryTask(Task):
logging.debug("loaded config: %r" % InventoryTask.config) logging.debug("loaded config: %r" % InventoryTask.config)
def update_state(self, **kwargs): def update_state(self, **kwargs):
meta = kwargs.get('meta', dict())
meta['task'] = self.name
logger.debug(json.dumps( logger.debug(json.dumps(
{'state': kwargs['state'], 'meta': str(kwargs['meta'])} {'state': kwargs['state'], 'meta': str(meta)}
)) ))
super().update_state(**kwargs) super().update_state(**kwargs)
...@@ -271,7 +273,6 @@ def update_neteng_managed_device_list(self): ...@@ -271,7 +273,6 @@ def update_neteng_managed_device_list(self):
self.update_state( self.update_state(
state=states.STARTED, state=states.STARTED,
meta={ meta={
'task': 'update_neteng_managed_device_list',
'message': 'querying netdash for managed routers' 'message': 'querying netdash for managed routers'
}) })
...@@ -281,7 +282,6 @@ def update_neteng_managed_device_list(self): ...@@ -281,7 +282,6 @@ def update_neteng_managed_device_list(self):
self.update_state( self.update_state(
state=states.STARTED, state=states.STARTED,
meta={ meta={
'task': 'update_neteng_managed_device_list',
'message': f'found {len(routers)} routers, saving details' 'message': f'found {len(routers)} routers, saving details'
}) })
...@@ -425,7 +425,6 @@ def reload_router_config(self, hostname): ...@@ -425,7 +425,6 @@ def reload_router_config(self, hostname):
self.update_state( self.update_state(
state=states.STARTED, state=states.STARTED,
meta={ meta={
'task': 'reload_router_config',
'hostname': hostname, 'hostname': hostname,
'message': 'loading router netconf data' 'message': 'loading router netconf data'
}) })
...@@ -463,7 +462,6 @@ def reload_router_config(self, hostname): ...@@ -463,7 +462,6 @@ def reload_router_config(self, hostname):
self.update_state( self.update_state(
state=states.STARTED, state=states.STARTED,
meta={ meta={
'task': 'reload_router_config',
'hostname': hostname, 'hostname': hostname,
'message': 'refreshing peers & clearing cache' 'message': 'refreshing peers & clearing cache'
}) })
...@@ -482,7 +480,6 @@ def reload_router_config(self, hostname): ...@@ -482,7 +480,6 @@ def reload_router_config(self, hostname):
self.update_state( self.update_state(
state=states.STARTED, state=states.STARTED,
meta={ meta={
'task': 'reload_router_config',
'hostname': hostname, 'hostname': hostname,
'message': 'refreshing snmp interface indexes' 'message': 'refreshing snmp interface indexes'
}) })
...@@ -601,7 +598,6 @@ def refresh_finalizer(self, pending_task_ids_json): ...@@ -601,7 +598,6 @@ def refresh_finalizer(self, pending_task_ids_json):
self.update_state( self.update_state(
state=states.STARTED, state=states.STARTED,
meta={ meta={
'task': 'refresh_finalizer',
'message': s 'message': s
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment