[blivet:master 2/3] Make dumpState catch and log all AttributeErrors (#1095329)

mulhern amulhern at redhat.com
Thu May 8 19:35:44 UTC 2014


Related: fed#1095329

It really seems wrong for it to fail on what may just be a mistake
on the part of some dict() somewhere.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index e5b5912..0f798f5 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1689,7 +1689,10 @@ class Blivet(object):
         """ Dump the current device list to the storage shelf. """
         key = "devices.%d.%s" % (time.time(), suffix)
         with contextlib.closing(shelve.open(self._dumpFile)) as shelf:
-            shelf[key] = [d.dict for d in self.devices]
+            try:
+                shelf[key] = [d.dict for d in self.devices]
+            except AttributeError:
+                log_exception_info()
 
     @property
     def packages(self):
-- 
1.8.3.1



More information about the anaconda-patches mailing list