Remove unnecessary exception handling in api entry

This is to make the code consistent with similar implementations,
and removes this handling as it is uncessary and can in cases
even hide issues.

Change-Id: I48edf6859b2179fe4605dbe8249b0a556e5c5bde
This commit is contained in:
Erik Olof Gunnar Andersson 2020-02-16 00:12:58 -08:00
parent be0cf7617b
commit d0e814a491
1 changed files with 15 additions and 18 deletions

View File

@ -34,23 +34,20 @@ LOG = logging.getLogger('senlin.api')
def main():
try:
config.parse_args(sys.argv, 'senlin-api')
logging.setup(CONF, 'senlin-api')
gmr.TextGuruMeditation.setup_autorun(version)
objects.register_all()
messaging.setup()
config.parse_args(sys.argv, 'senlin-api')
logging.setup(CONF, 'senlin-api')
gmr.TextGuruMeditation.setup_autorun(version)
objects.register_all()
messaging.setup()
app = wsgi.load_paste_app()
app = wsgi.load_paste_app()
host = CONF.senlin_api.bind_host
port = CONF.senlin_api.bind_port
LOG.info('Starting Senlin API on %(host)s:%(port)s',
{'host': host, 'port': port})
profiler.setup('senlin-api', host)
server = wsgi.Server('senlin-api', CONF.senlin_api)
server.start(app, default_port=port)
systemd.notify_once()
server.wait()
except RuntimeError as ex:
sys.exit("ERROR: %s" % str(ex))
host = CONF.senlin_api.bind_host
port = CONF.senlin_api.bind_port
LOG.info('Starting Senlin API on %(host)s:%(port)s',
{'host': host, 'port': port})
profiler.setup('senlin-api', host)
server = wsgi.Server('senlin-api', CONF.senlin_api)
server.start(app, default_port=port)
systemd.notify_once()
server.wait()