summaryrefslogtreecommitdiffstats
path: root/bin/nova-api-paste
diff options
context:
space:
mode:
Diffstat (limited to 'bin/nova-api-paste')
-rwxr-xr-xbin/nova-api-paste22
1 files changed, 12 insertions, 10 deletions
diff --git a/bin/nova-api-paste b/bin/nova-api-paste
index 3d26fdb4f..9bcb98372 100755
--- a/bin/nova-api-paste
+++ b/bin/nova-api-paste
@@ -27,9 +27,6 @@ import sys
from paste import deploy
-from nova import flags
-from nova import wsgi
-
# If ../nova/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
@@ -40,6 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)
+from nova import flags
+from nova import wsgi
+
LOG = logging.getLogger('nova.api')
LOG.setLevel(logging.DEBUG)
LOG.addHandler(logging.StreamHandler())
@@ -65,22 +65,24 @@ def load_configuration(paste_config):
if FLAGS.verbose:
logging.getLogger().setLevel(logging.DEBUG)
return config
- LOG.debug("Paste config at %s has no secion for known apis", paste_config)
- print "Paste config at %s has no secion for any known apis" % paste_config
+ LOG.debug(_("Paste config at %s has no secion for known apis"),
+ 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)
+ LOG.debug(_("Launching %s api 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)
+ LOG.debug(_("Using paste.deploy config at: %s"), configfile)
config = load_configuration(paste_config_file)
- LOG.debug("Configuration: %r", config)
+ LOG.debug(_("Configuration: %r"), config)
server = wsgi.Server()
ip = config.get('host', None)
for api in API_ENDPOINTS:
@@ -89,7 +91,7 @@ def run_app(paste_config_file):
continue
host = config.get("%s_host" % api, None) or ip or '0.0.0.0'
launch_api(configfile, api, server, port, host)
- LOG.debug("All api servers launched, now waiting")
+ LOG.debug(_("All api servers launched, now waiting"))
server.wait()
@@ -104,4 +106,4 @@ if __name__ == '__main__':
run_app(configfile)
break
else:
- LOG.debug("Skipping missing configuration: %s", configfile)
+ LOG.debug(_("Skipping missing configuration: %s"), configfile)