Fix logging in vbmcd
Currently we log any exceptions as INFO and without much details. Start logging them as ERROR with tracebacks. Add missing logging. However, don't treat KeyboardInterrupt as an exception, just exit. Also log the successful start-up, its absence is confusing. Change-Id: I7464ce425ed05248152f264d64950e0ab1c0aec0
This commit is contained in:
parent
834d02e616
commit
b12197bb0d
@ -59,6 +59,8 @@ def main_loop(vbmc_manager, handle_command):
|
||||
poller = zmq.Poller()
|
||||
poller.register(socket, zmq.POLLIN)
|
||||
|
||||
LOG.info('Started vBMC server on port %s', server_port)
|
||||
|
||||
while True:
|
||||
socks = dict(poller.poll(timeout=TIMER_PERIOD))
|
||||
if socket in socks and socks[socket] == zmq.POLLIN:
|
||||
@ -212,7 +214,9 @@ def application():
|
||||
|
||||
try:
|
||||
main_loop(vbmc_manager, command_dispatcher)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
LOG.info('Got keyboard interrupt, exiting')
|
||||
vbmc_manager.periodic(shutdown=True)
|
||||
except Exception as ex:
|
||||
LOG.error(
|
||||
'Control server error: %(error)s', {'error': ex}
|
||||
|
@ -124,7 +124,7 @@ class VirtualBMCManager(object):
|
||||
vbmc = VirtualBMC(**bmc_config)
|
||||
|
||||
except Exception as ex:
|
||||
LOG.error(
|
||||
LOG.exception(
|
||||
'Error running vBMC with configuration '
|
||||
'%(opts)s: %(error)s', {'opts': show_options,
|
||||
'error': ex}
|
||||
@ -135,7 +135,7 @@ class VirtualBMCManager(object):
|
||||
vbmc.listen(timeout=CONF['ipmi']['session_timeout'])
|
||||
|
||||
except Exception as ex:
|
||||
LOG.info(
|
||||
LOG.exception(
|
||||
'Shutdown vBMC for domain %(domain)s, cause '
|
||||
'%(error)s', {'domain': show_options['domain_name'],
|
||||
'error': ex}
|
||||
@ -299,6 +299,7 @@ class VirtualBMCManager(object):
|
||||
lets_enable=True)
|
||||
|
||||
except Exception as e:
|
||||
LOG.exception('Failed to start domain %s', domain_name)
|
||||
return 1, ('Failed to start domain %(domain)s. Error: '
|
||||
'%(error)s' % {'domain': domain_name, 'error': e})
|
||||
|
||||
@ -311,6 +312,7 @@ class VirtualBMCManager(object):
|
||||
self._vbmc_enabled(domain_name, lets_enable=False)
|
||||
|
||||
except Exception as ex:
|
||||
LOG.exception('Failed to stop domain %s', domain_name)
|
||||
return 1, str(ex)
|
||||
|
||||
self._sync_vbmc_states()
|
||||
|
Loading…
Reference in New Issue
Block a user