From 0afbadd3eef53680756c9050f7149c737e041f5a Mon Sep 17 00:00:00 2001 From: Cosmin Poieana Date: Fri, 14 Aug 2015 17:17:37 +0000 Subject: [PATCH] Log any uncaught exception thrown by the service Change-Id: I0e5fb7e382f465bbffab81ac17c8edfa43f11ede --- cloudbaseinit/shell.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cloudbaseinit/shell.py b/cloudbaseinit/shell.py index 17fa32e0..44079a7f 100644 --- a/cloudbaseinit/shell.py +++ b/cloudbaseinit/shell.py @@ -15,18 +15,25 @@ import sys from oslo_config import cfg +from oslo_log import log as oslo_logging from cloudbaseinit import init from cloudbaseinit.utils import log as logging CONF = cfg.CONF +LOG = oslo_logging.getLogger(__name__) + def main(): CONF(sys.argv[1:]) logging.setup('cloudbaseinit') - init.InitManager().configure_host() + try: + init.InitManager().configure_host() + except Exception as exc: + LOG.exception(exc) + raise if __name__ == "__main__":