def main(): config.init(app.common_opts, sys.argv[1:]) application = app.setup_app() host = CONF.bind_host port = CONF.bind_port workers = CONF.api_workers if workers < 1: LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers) workers = 1 LOG.info(_LI("Nova_APIGW on http://%(host)s:%(port)s with %(workers)s"), { 'host': host, 'port': port, 'workers': workers }) service = wsgi.Server(CONF, 'Trio2o Nova_APIGW', application, host, port) restapp.serve(service, CONF, workers) LOG.info(_LI("Configuration:")) CONF.log_opt_values(LOG, std_logging.INFO) restapp.wait()
def _setup_logging(): """Sets up the logging options for a log with supplied name.""" product_name = "trio2o" logging.setup(cfg.CONF, product_name) LOG.info(_LI("Logging enabled!")) LOG.info(_LI("%(prog)s version %(version)s"), { 'prog': sys.argv[0], 'version': version.version_info }) LOG.debug("command line: %s", " ".join(sys.argv))
def test_rpc(self, ctx, payload): LOG.info(_LI("xmanager receive payload: %s"), payload) info_text = "xmanager receive payload: %s" % payload return info_text
def start(self): ver_str = version.version_info LOG.info(_LI('Starting %(topic)s node (version %(version)s)'), {'topic': self.topic, 'version': ver_str}) self.basic_config_check() self.manager.init_host() self.manager.pre_start_hook() LOG.debug(_("Creating RPC server for service %s"), self.topic) target = messaging.Target(topic=self.topic, server=self.host) endpoints = [ self.manager, baserpc.BaseServerRPCAPI(self.manager.service_name) ] endpoints.extend(self.manager.additional_endpoints) self.rpc_server = rpc.get_server(target, endpoints, self.serializer) self.rpc_server.start() self.manager.post_start_hook() 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.interval_max)
def main(): config.init(xservice.common_opts, sys.argv[1:]) host = CONF.host workers = CONF.workers if workers < 1: LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers) workers = 1 LOG.info(_LI("XJob Server on http://%(host)s with %(workers)s"), { 'host': host, 'workers': workers }) xservice.serve(xservice.create_service(), workers) LOG.info(_LI("Configuration:")) CONF.log_opt_values(LOG, std_logging.INFO) xservice.wait()