7008402 fix for 7006443 broke list_checkpoints Build156
authorAlok Aggarwal <Alok.Aggarwal@Sun.COM>
Tue, 21 Dec 2010 13:38:55 -0800
changeset 968 196eafb14485
parent 967 524de3368b08
child 969 539f911240d6
7008402 fix for 7006443 broke list_checkpoints
usr/src/cmd/distro_const/__init__.py
--- a/usr/src/cmd/distro_const/__init__.py	Mon Dec 20 15:30:30 2010 -0800
+++ b/usr/src/cmd/distro_const/__init__.py	Tue Dec 21 13:38:55 2010 -0800
@@ -347,7 +347,7 @@
 
 
 def setup_build_dataset(base_dataset, base_action, base_dataset_mp,
-                        resume_checkpoint=None):
+                        resume_checkpoint=None, execute=True):
     """ Setup the build datasets for use by DC. This includes setting up:
     - top level build dataset
     - a child dataset named 'build_data'
@@ -362,6 +362,9 @@
     eng.register_checkpoint(TI_DICT["name"], TI_DICT["mod_path"],
                             TI_DICT["class"])
 
+    if not execute:
+        return
+
     build_data = zfs_lib.Dataset(os.path.join(base_dataset, "build_data"))
     empty_snap = zfs_lib.Dataset(os.path.join(base_dataset,
                                               "build_data@empty"))
@@ -553,6 +556,12 @@
         base_dataset, base_action, base_dataset_mp = validate_target()
 
         if options.list_checkpoints:
+            # set the execute flag of setup_build_dataset to 'False'
+            # to prevent any actions from occuring. The TI checkpoint
+            # needs to be registered with the engine for list_checkpoints
+            # to work correctly.
+            setup_build_dataset(base_dataset, base_action, base_dataset_mp,
+                                resume_checkpoint, execute=False)
             # set the InstallEngine.dataset property to enable snapshots
             eng.dataset = os.path.join(base_dataset, "build_data")