def main(): global_conf.logging() utils.default_flagfile("nova.conf") flags.FLAGS(sys.argv) FLAGS = flags.FLAGS conf = global_conf._conf for param in ("rabbit_host", "rabbit_port", "rabbit_userid", "rabbit_password", "rabbit_virtual_host", "rabbit_durable_queues", "control_exchange"): conf[param] = getattr(FLAGS, param) nova_api_config = ConfigParser() nova_api_config.read(["/etc/nova/api-paste.ini"]) keystone_conf = {} conf_map = {"auth_uri": "auth_uri", "admin_tenant_name": "tenant_name", "admin_user": "******", "admin_password": "******"} for param_nova, param_client in conf_map.iteritems(): try: value = nova_api_config.get("filter:authtoken", param_nova) except Exception as e: print e else: keystone_conf[param_client] = value conf["keystone_conf"] = keystone_conf json.dump(conf, open(CONFIG_FILE, "w"), indent=4, sort_keys=True)
def main(): global_conf.logging() utils.default_flagfile("nova.conf") flags.FLAGS(sys.argv) FLAGS = flags.FLAGS conf = global_conf._conf for param in ("rabbit_host", "rabbit_port", "rabbit_userid", "rabbit_password", "rabbit_virtual_host", "rabbit_durable_queues", "control_exchange"): conf[param] = getattr(FLAGS, param) nova_api_config = ConfigParser() nova_api_config.read(["/etc/nova/api-paste.ini"]) keystone_conf = {} conf_map = { "auth_uri": "auth_uri", "admin_tenant_name": "tenant_name", "admin_user": "******", "admin_password": "******" } for param_nova, param_client in conf_map.iteritems(): try: value = nova_api_config.get("filter:authtoken", param_nova) except Exception as e: print e else: keystone_conf[param_client] = value conf["keystone_conf"] = keystone_conf json.dump(conf, open(CONFIG_FILE, "w"), indent=4, sort_keys=True)
def main(): global_conf.logging() arg_parser = argparse.ArgumentParser() arg_parser.add_argument("--reload", "-r", default=False, action="store_true", help="reload when the source changes") arg_parser.add_argument( "host:port", nargs="?", default="%s:%s" % (global_conf.host, global_conf.port), help="host:port" ) args = arg_parser.parse_args() db.create_all() listen = getattr(args, "host:port").split(":") app.debug = True app.run(host=listen[0], port=int(listen[1]), use_reloader=args.reload)
def main(): if len(sys.argv) < 2: complain_usage() global_conf.logging() # make Flask-SQLalchemy happy _request_ctx_stack.push(1) db.create_all() if sys.argv[1] == "sync": return if sys.argv[1] == "glance": migrate_glance() elif sys.argv[1] == "nova": migrate_nova() elif sys.argv[1] == "billing_v1" and len(sys.argv) >= 3: migrate_billing_v1(sys.argv[2]) else: complain_usage()
def main(): global_conf.logging() arg_parser = argparse.ArgumentParser() arg_parser.add_argument("--reload", "-r", default=False, action="store_true", help="reload when the source changes") arg_parser.add_argument("host:port", nargs="?", default="%s:%s" % (global_conf.host, global_conf.port), help="host:port") args = arg_parser.parse_args() db.create_all() listen = getattr(args, "host:port").split(':') app.debug = True app.run(host=listen[0], port=int(listen[1]), use_reloader=args.reload)
def main(): global_conf.logging() global_conf.load_nova_conf() service = amqp.Service() service.start() service.wait()
def main(): global_conf.logging() LOG.info("starting os_amqp") service = amqp.Service() service.start() service.wait()