def on_msg(client, body, routing_key): try: entity = Entity.from_json(body) assert isinstance(entity, BaseTask) worker = TaskThreadWorker(client, entity) worker.start() except Exception: log.error("on msg processing", exc_info=True)
def vm_inventory(client): log.debug('Inventory VMs') task = VMInventoryTask(node_oid=client.oid) worker = TaskThreadWorker(client, task) worker.start()
def on_node_msg(client, body, routing_key): task = Entity.from_json(body) self.assertEqual(task.node_oid, self.node_oid) worker = TaskThreadWorker(client, task) worker.start()