Пример #1
0
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)
Пример #2
0
def vm_inventory(client):
    log.debug('Inventory VMs')
    task = VMInventoryTask(node_oid=client.oid)
    worker = TaskThreadWorker(client, task)
    worker.start()
Пример #3
0
 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()