Add indication when quantum server started.

Bug #1076834

Option values are printed in two phases due to our
system's starting way. Last print will print out all
option values included in all config files.

In the end when quantum server started, we have an
indication for it.

Change-Id: I4ed9952c94fe74ea946733dc3a94cb2bb2aba37c
This commit is contained in:
gongysh 2012-11-09 10:16:18 +08:00
parent df420ccb6e
commit 87de4d3a33

View File

@ -15,6 +15,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging as std_logging
from quantum.common import config from quantum.common import config
from quantum.openstack.common import cfg from quantum.openstack.common import cfg
from quantum.openstack.common import log as logging from quantum.openstack.common import log as logging
@ -58,16 +60,8 @@ class QuantumApiService(WsgiService):
# Log the options used when starting if we're in debug mode... # Log the options used when starting if we're in debug mode...
config.setup_logging(cfg.CONF) config.setup_logging(cfg.CONF)
LOG.debug("*" * 80) # Dump the initial option values
LOG.debug("Configuration options gathered from config file:") cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
LOG.debug("================================================")
items = dict([(k, v) for k, v in cfg.CONF.items()
if k not in ('__file__', 'here')])
for key, value in sorted(items.items()):
LOG.debug("%(key)-30s %(value)s" % {'key': key,
'value': value,
})
LOG.debug("*" * 80)
service = cls(app_name) service = cls(app_name)
return service return service
@ -76,7 +70,7 @@ def serve_wsgi(cls):
try: try:
service = cls.create() service = cls.create()
except Exception: except Exception:
logging.exception('in WsgiService.create()') LOG.exception('in WsgiService.create()')
raise raise
service.start() service.start()
@ -91,4 +85,9 @@ def _run_wsgi(app_name):
return return
server = wsgi.Server("Quantum") server = wsgi.Server("Quantum")
server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host) server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host)
# Dump all option values here after all options are parsed
cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
LOG.info("Quantum service started, listening on %(host)s:%(port)s" %
{'host': cfg.CONF.bind_host,
'port': cfg.CONF.bind_port})
return server return server