Exemplo n.º 1
0
    def __init__(self):
        target = messaging.Target(topic=self.TOPIC,
                                  version=self.RPC_API_VERSION)

        serializer = base.MasakariObjectSerializer()

        self.client = get_client(target, serializer=serializer)
Exemplo n.º 2
0
    def start(self):
        verstr = version.version_string_with_package()
        LOG.info('Starting %(topic)s (version %(version)s)', {
            'topic': self.topic,
            'version': verstr
        })
        self.basic_config_check()

        LOG.debug("Creating RPC server for service %s", self.topic)

        target = messaging.Target(topic=self.topic, server=self.host)
        endpoints = [self.manager]
        serializer = objects_base.MasakariObjectSerializer()
        self.rpcserver = rpc.get_server(target, endpoints, serializer)
        self.rpcserver.start()

        if self.periodic_enable:
            if self.periodic_fuzzy_delay:
                initial_delay = random.randint(0, self.periodic_fuzzy_delay)
            else:
                initial_delay = None

            self.tg.add_dynamic_timer(
                self.periodic_tasks,
                initial_delay=initial_delay,
                periodic_interval_max=self.periodic_interval_max)
Exemplo n.º 3
0
 def __init__(self):
     super(EngineAPI, self).__init__()
     target = messaging.Target(topic=self.TOPIC,
                               version=self.RPC_API_VERSION)
     serializer = objects_base.MasakariObjectSerializer()
     self.client = rpc.get_client(target, serializer=serializer)