Code refactor for prepare_service

Put the common codes used by api and conductor into a function.

Closes-Bug: 1472961
Change-Id: I3f7d431d9a91d9979d940d794db5bc383a077826
changes/75/199875/3
Wanghua 7 years ago committed by Hua Wang
parent 93ca5d37b4
commit af35cb173d
  1. 1
      magnum/cmd/api.py
  2. 5
      magnum/cmd/conductor.py
  3. 1
      magnum/common/service.py

@ -31,7 +31,6 @@ LOG = logging.getLogger(__name__)
def main():
logging.register_options(cfg.CONF)
service.prepare_service(sys.argv)
app = api_app.setup_app()

@ -23,6 +23,7 @@ from oslo_log import log as logging
from oslo_service import service
from magnum.common import rpc_service
from magnum.common import service as magnum_service
from magnum.common import short_id
from magnum.conductor.handlers import bay_conductor
from magnum.conductor.handlers import conductor_listener
@ -35,9 +36,7 @@ LOG = logging.getLogger(__name__)
def main():
logging.register_options(cfg.CONF)
cfg.CONF(sys.argv[1:], project='magnum')
logging.setup(cfg.CONF, 'magnum')
magnum_service.prepare_service(sys.argv)
LOG.info(_LI('Starting server in PID %s') % os.getpid())
LOG.debug("Configuration:")

@ -17,5 +17,6 @@ from oslo_log import log as logging
def prepare_service(argv=[]):
logging.register_options(cfg.CONF)
cfg.CONF(argv[1:], project='magnum')
logging.setup(cfg.CONF, 'magnum')

Loading…
Cancel
Save