summaryrefslogtreecommitdiffstats
path: root/bin/nova-api-paste
diff options
context:
space:
mode:
authorTodd Willey <todd@ansolabs.com>2010-12-29 17:08:42 -0500
committerTodd Willey <todd@ansolabs.com>2010-12-29 17:08:42 -0500
commit66a074cc74a6c3cc09d7b36f3e5dcb5ad5e7b6d8 (patch)
treea830335edb7520726338250129ac9cb64121f735 /bin/nova-api-paste
parent6ba4e731921051e9b401cfb4222fbcb7afe46a34 (diff)
downloadnova-66a074cc74a6c3cc09d7b36f3e5dcb5ad5e7b6d8.tar.gz
nova-66a074cc74a6c3cc09d7b36f3e5dcb5ad5e7b6d8.tar.xz
nova-66a074cc74a6c3cc09d7b36f3e5dcb5ad5e7b6d8.zip
Pep-8 cleanup.
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']