summaryrefslogtreecommitdiffstats
path: root/bin/nova-api-paste
diff options
context:
space:
mode:
Diffstat (limited to 'bin/nova-api-paste')
-rwxr-xr-xbin/nova-api-paste4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/nova-api-paste b/bin/nova-api-paste
index dcb76522f..3d26fdb4f 100755
--- a/bin/nova-api-paste
+++ b/bin/nova-api-paste
@@ -48,6 +48,7 @@ FLAGS = flags.FLAGS
API_ENDPOINTS = ['ec2', 'openstack']
+
def load_configuration(paste_config):
"""Load the paste configuration from the config file and return it."""
config = None
@@ -68,12 +69,14 @@ def load_configuration(paste_config):
print "Paste config at %s has no secion for any known apis" % paste_config
os.exit(1)
+
def launch_api(paste_config_file, section, server, port, host):
"""Launch an api server from the specified port and IP."""
LOG.debug("Launching api %s on %s:%s", section, host, port)
app = deploy.loadapp('config:%s' % paste_config_file, name=section)
server.start(app, int(port), host)
+
def run_app(paste_config_file):
LOG.debug("Using paste.deploy config at: %s", configfile)
config = load_configuration(paste_config_file)
@@ -89,6 +92,7 @@ def run_app(paste_config_file):
LOG.debug("All api servers launched, now waiting")
server.wait()
+
if __name__ == '__main__':
FLAGS(sys.argv)
configfiles = ['/etc/nova/nova-api.conf']