summaryrefslogtreecommitdiffstats
path: root/nova/service.py
diff options
context:
space:
mode:
authorJustin Santa Barbara <justin@fathomdb.com>2011-03-07 15:36:04 -0800
committerJustin Santa Barbara <justin@fathomdb.com>2011-03-07 15:36:04 -0800
commite69c802aaf40f3b90789aeef8bf3ef5dcbbcb2f3 (patch)
tree1010b5e327d02ac71099380d64adc5d41b83bc4c /nova/service.py
parentbe54e37bbd79293ce41f8fa8dfe40022aebb6fff (diff)
downloadnova-e69c802aaf40f3b90789aeef8bf3ef5dcbbcb2f3.tar.gz
nova-e69c802aaf40f3b90789aeef8bf3ef5dcbbcb2f3.tar.xz
nova-e69c802aaf40f3b90789aeef8bf3ef5dcbbcb2f3.zip
Moved FLAGS.paste_config to its re-usable location
Diffstat (limited to 'nova/service.py')
-rw-r--r--nova/service.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/service.py b/nova/service.py
index 389a6b2df..5a8d58695 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -56,6 +56,8 @@ flags.DEFINE_integer('ec2_listen_port', 8773, 'port for ec2 api to listen')
flags.DEFINE_string('osapi_listen', "0.0.0.0",
'IP address for OpenStack API to listen')
flags.DEFINE_integer('osapi_listen_port', 8774, 'port for os api to listen')
+flags.DEFINE_string('paste_config', "api-paste.ini",
+ 'File name for the paste.deploy config for nova-api')
class Service(object):
@@ -238,9 +240,11 @@ class ApiService(WsgiService):
@classmethod
def create(cls, conf=None):
if not conf:
- conf = wsgi.paste_config_file('nova-api.conf')
+ conf = wsgi.paste_config_file(FLAGS.paste_config)
if not conf:
- raise exception.Error(_("Cannot load nova-api.conf"))
+ message = (_("No paste configuration found for: %s"),
+ FLAGS.paste_config)
+ raise exception.Error(message)
api_endpoints = ['ec2', 'osapi']
service = cls(conf, api_endpoints)
return service
@@ -277,7 +281,7 @@ def wait():
greenthread.sleep(5)
-def serve_wsgi(cls, conf):
+def serve_wsgi(cls, conf=None):
try:
service = cls.create(conf)
except Exception: