Exemplo n.º 1
0
 def on_mngr_msg(client, body, routing_key):
     inst = self.entity_from_json(body)
     if isinstance(inst, IFConfigReport):
         self.stop()
     if inst.__class__.__name__ == 'NodeOnlineReport':
         smanager = SubprocessManager(self.node)
         smanager.add_report(IFConfigReport, 15)
         smanager.start()
Exemplo n.º 2
0
def channel_created(client):
    log.debug("%s to RabbitMQ is created" % client.channel)
    on_node_started(client)
    smanager = SubprocessManager(client)
    smanager.add_report(IFConfigReport, 30)
    smanager.add_report(BrctlShowReport, 300)
    smanager.add_report(DFReport, 300)
    smanager.start()
    heartbeat = PeriodicCallback(partial(on_node_started, client),
                                 15000)
    heartbeat.start()
    client.io_loop.add_timeout(time.time() + 15,
                               partial(vm_inventory, client))