Add a flag to disable ec2 or osapi.
This commit is contained in:
14
bin/nova-api
14
bin/nova-api
@@ -36,17 +36,21 @@ if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
|
|||||||
import nova.service
|
import nova.service
|
||||||
import nova.utils
|
import nova.utils
|
||||||
|
|
||||||
|
from nova import flags
|
||||||
|
|
||||||
|
|
||||||
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Launch EC2 and OSAPI services."""
|
"""Launch EC2 and OSAPI services."""
|
||||||
nova.utils.Bootstrapper.bootstrap_binary(sys.argv)
|
nova.utils.Bootstrapper.bootstrap_binary(sys.argv)
|
||||||
|
|
||||||
ec2 = nova.service.WSGIService("ec2")
|
|
||||||
osapi = nova.service.WSGIService("osapi")
|
|
||||||
|
|
||||||
launcher = nova.service.Launcher()
|
launcher = nova.service.Launcher()
|
||||||
launcher.launch_service(ec2)
|
|
||||||
launcher.launch_service(osapi)
|
for api in FLAGS.enabled_apis:
|
||||||
|
service = nova.service.WSGIService(api)
|
||||||
|
launcher.launch_service(service)
|
||||||
|
|
||||||
signal.signal(signal.SIGTERM, lambda *_: launcher.stop())
|
signal.signal(signal.SIGTERM, lambda *_: launcher.stop())
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,8 @@ DEFINE_string('rabbit_virtual_host', '/', 'rabbit virtual host')
|
|||||||
DEFINE_integer('rabbit_retry_interval', 10, 'rabbit connection retry interval')
|
DEFINE_integer('rabbit_retry_interval', 10, 'rabbit connection retry interval')
|
||||||
DEFINE_integer('rabbit_max_retries', 12, 'rabbit connection attempts')
|
DEFINE_integer('rabbit_max_retries', 12, 'rabbit connection attempts')
|
||||||
DEFINE_string('control_exchange', 'nova', 'the main exchange to connect to')
|
DEFINE_string('control_exchange', 'nova', 'the main exchange to connect to')
|
||||||
|
DEFINE_list('enabled_apis', ['ec2', 'osapi'],
|
||||||
|
'list of APIs to enable by default')
|
||||||
DEFINE_string('ec2_host', '$my_ip', 'ip of api server')
|
DEFINE_string('ec2_host', '$my_ip', 'ip of api server')
|
||||||
DEFINE_string('ec2_dmz_host', '$my_ip', 'internal ip of api server')
|
DEFINE_string('ec2_dmz_host', '$my_ip', 'internal ip of api server')
|
||||||
DEFINE_integer('ec2_port', 8773, 'cloud controller port')
|
DEFINE_integer('ec2_port', 8773, 'cloud controller port')
|
||||||
|
|||||||
Reference in New Issue
Block a user