]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Log the exception so app loading issues can be debuged
authorJason Kölker <jason@koelker.net>
Thu, 24 May 2012 17:17:21 +0000 (12:17 -0500)
committerJason Kölker <jason@koelker.net>
Thu, 24 May 2012 17:17:21 +0000 (12:17 -0500)
* Fixes LP1004062

Change-Id: Iae04f2789fe310a52550354463fe109c13e8ceeb

quantum/common/config.py

index b024ee3a6014f7351f5e0550ddb6f8b336ec7fa9..6fda8eb936b63bcab0f459c4e3f873c647f48f7a 100644 (file)
@@ -32,6 +32,7 @@ from paste import deploy
 from quantum.common import flags
 
 
+LOG = logging.getLogger(__name__)
 DEFAULT_LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s"
 DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
 
@@ -315,10 +316,11 @@ def load_paste_app(app_name, options, args):
 
     try:
         app = deploy.loadapp("config:%s" % conf_file, name=app_name)
-    except (LookupError, ImportError), e:
-        raise RuntimeError("Unable to load %(app_name)s from "
-                           "configuration file %(conf_file)s."
-                           "\nGot: %(e)r" % locals())
+    except (LookupError, ImportError):
+        msg = ("Unable to load %(app_name)s from "
+               "configuration file %(conf_file)s.") % locals()
+        LOG.exception(msg)
+        raise RuntimeError(msg)
     return conf, app