8394 image-update without a --be-name fails.
authorRich Burridge <rich.burridge@sun.com>
Thu, 23 Apr 2009 19:11:18 -0700
changeset 1080 147a665c552c
parent 1079 2697c2e9021e
child 1081 0cc3e524ea7f
8394 image-update without a --be-name fails.
src/modules/client/api.py
src/modules/client/bootenv.py
--- a/src/modules/client/api.py	Thu Apr 23 16:38:42 2009 -0700
+++ b/src/modules/client/api.py	Thu Apr 23 19:11:18 2009 -0700
@@ -122,6 +122,7 @@
         @staticmethod
         def check_be_name(be_name):
                 bootenv.BootEnv.check_be_name(be_name)
+                return True
 
         def plan_install(self, pkg_list, filters, refresh_catalogs=True,
             noexecute=False, verbose=False, update_index=True):
--- a/src/modules/client/bootenv.py	Thu Apr 23 16:38:42 2009 -0700
+++ b/src/modules/client/bootenv.py	Thu Apr 23 19:11:18 2009 -0700
@@ -189,8 +189,10 @@
         @staticmethod
         def check_be_name(be_name):
                 try:
-                        if be_name is None or \
-                            be.beVerifyBEName(be_name) != 0:
+                        if be_name is None:
+                                return
+
+                        if be.beVerifyBEName(be_name) != 0:
                                 raise api_errors.InvalidBENameException(be_name)
 
                         # Check for the old beList() API since pkg(1) can be
@@ -224,8 +226,7 @@
                         # Create a clone of the live BE and mount it.
                         self.destroy_snapshot()
 
-                        if not self.check_be_name(be_name):
-                                raise api_errors.InvalidBENameException(be_name)
+                        self.check_be_name(be_name)
 
                         # Do nothing with the returned snapshot name
                         # that is taken of the clone during beCopy.
@@ -450,9 +451,8 @@
 
         @staticmethod
         def check_be_name(be_name):
-                if be_name is None:
-                        return True
-                raise api_errors.BENamingNotSupported(be_name)
+                if be_name:
+                        raise api_errors.BENamingNotSupported(be_name)
 
         def init_image_recovery(self, img, be_name=None):
                 if be_name is not None: