From 76e3d2e2f6c09e19f748971d509937b64cf46f45 Mon Sep 17 00:00:00 2001 From: Yosef Hoffman Date: Tue, 10 May 2016 11:44:56 -0400 Subject: [PATCH] Log "https" if using SSL When starting the Watcher API service, the URI it served to is shown in a log message. In this log message (in watcher/cmd/api.py) take into account the case where SSL has been enabled with CONF.api.enable_ssl_api set to True and format this log message accordingly. Change-Id: I98541810139d9d4319ac89f21a5e0bc25454ee62 Closes-Bug: #1580044 --- watcher/cmd/api.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/watcher/cmd/api.py b/watcher/cmd/api.py index 27ab7f98a..cb86df082 100644 --- a/watcher/cmd/api.py +++ b/watcher/cmd/api.py @@ -38,17 +38,18 @@ def main(): gmr.TextGuruMeditation.setup_autorun(version) host, port = cfg.CONF.api.host, cfg.CONF.api.port + protocol = "http" if not CONF.api.enable_ssl_api else "https" # Build and start the WSGI app server = service.WSGIService( 'watcher-api', CONF.api.enable_ssl_api) if host == '0.0.0.0': LOG.info(_('serving on 0.0.0.0:%(port)s, ' - 'view at http://127.0.0.1:%(port)s') % - dict(port=port)) + 'view at %(protocol)s://127.0.0.1:%(port)s') % + dict(protocol=protocol, port=port)) else: - LOG.info(_('serving on http://%(host)s:%(port)s') % - dict(host=host, port=port)) + LOG.info(_('serving on %(protocol)s://%(host)s:%(port)s') % + dict(protocol=protocol, host=host, port=port)) launcher = service.process_launcher() launcher.launch_service(server, workers=server.workers)