From ec70a02ddf6055e28fe24c4bb1396b59926de03f Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 19 Aug 2019 14:04:21 -0400 Subject: [PATCH] Log exception info when objects fail to init This will now log an error with a traceback indicating what caused the ProgrammingError exception instead of hiding the cause of the failure. Change-Id: I82e4d2c6961c6b456d129d8a0afd5972ff53785f --- cinder/objects/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cinder/objects/base.py b/cinder/objects/base.py index 25215e6fe13..1efb281d1d0 100644 --- a/cinder/objects/base.py +++ b/cinder/objects/base.py @@ -279,9 +279,10 @@ class CinderPersistentObject(object): # registration. try: cls.model = db.get_model_for_versioned_object(cls) - except (ImportError, AttributeError): + except (ImportError, AttributeError) as e: msg = _("Couldn't find ORM model for Persistent Versioned " "Object %s.") % cls.obj_name() + LOG.exception("Failed to initialize object.") raise exception.ProgrammingError(reason=msg) @contextlib.contextmanager