diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py index bb09fffd66b1fd78b843a962a9aa7f11b2048f0c..93346262d2419bb9994724779efdddbe24b10dd1 100644 --- a/inventory_provider/tasks/worker.py +++ b/inventory_provider/tasks/worker.py @@ -51,6 +51,8 @@ class InventoryTask(Task): def __init__(self): + self.pid = os.getpid() + if InventoryTask.config: return @@ -69,6 +71,8 @@ class InventoryTask(Task): def update_state(self, **kwargs): meta = kwargs.setdefault('meta', dict()) meta['task'] = self.name + meta['worker'] = self.request.hostname + meta['pid'] = self.pid logger.debug(json.dumps( {'state': kwargs['state'], 'meta': str(meta)} )) @@ -87,6 +91,9 @@ class InventoryTask(Task): """ return { 'task': self.name, + 'id': self.request.id, + 'worker': self.request.hostname, + 'pid': self.pid, 'warning': warning, 'message': message }