18486 package operations can fail during cache cleanup
authorShawn Walker <shawn.walker@oracle.com>
Tue, 26 Jul 2011 18:22:34 -0700
changeset 2475 77cfb483dd88
parent 2474 e815a9785747
child 2476 25342deb3749
18486 package operations can fail during cache cleanup
src/modules/manifest.py
src/tests/pkg5unittest.py
--- a/src/modules/manifest.py	Tue Jul 26 17:36:18 2011 -0700
+++ b/src/modules/manifest.py	Tue Jul 26 18:22:34 2011 -0700
@@ -1018,7 +1018,10 @@
                                         if e.errno != errno.ENOENT:
                                                 raise
                 except EnvironmentError, e:
-                        raise apx._convert_error(e)
+                        if e.errno != errno.ENOENT:
+                                # Only raise error if failure wasn't due to
+                                # cache directory not existing.
+                                raise apx._convert_error(e)
 
         def __load_cached_data(self, name):
                 """Private helper function for loading arbitrary cached manifest
--- a/src/tests/pkg5unittest.py	Tue Jul 26 17:36:18 2011 -0700
+++ b/src/tests/pkg5unittest.py	Tue Jul 26 18:22:34 2011 -0700
@@ -1916,7 +1916,8 @@
                                         copy_manifests(src_root, dest_root)
 
         def get_img_manifest_cache_dir(self, pfmri, ii=None):
-                """Returns the path to the manifest for the given fmri."""
+                """Returns the path to the manifest cache directory for the
+                given fmri."""
 
                 img = self.get_img_api_obj(ii=ii).img