src/modules/client/image.py
changeset 2330 9451b3f28f4c
parent 2310 ce10607d5332
child 2331 cc898866d552
--- a/src/modules/client/image.py	Tue May 03 12:25:48 2011 +0100
+++ b/src/modules/client/image.py	Thu May 05 11:21:34 2011 -0700
@@ -559,7 +559,10 @@
                     smf.get_state("svc:/system/pkg/sysrepo:default") in \
                     (smf.SMF_SVC_TMP_ENABLED, smf.SMF_SVC_ENABLED):
                         smf.refresh(["svc:/system/pkg/sysrepo:default"])
-                self.transport.cfg.reset_caches()
+
+                # This ensures all old transport configuration is thrown away.
+                self.transport = transport.Transport(
+                    transport.ImageTransportCfg(self))
 
         def mkdirs(self, root=None, version=None):
                 """Create any missing parts of the image's directory structure.
@@ -605,6 +608,10 @@
                 else:
                         self.img_prefix = img_root_prefix
 
+                # Use a new Transport object every time location is changed.
+                self.transport = transport.Transport(
+                    transport.ImageTransportCfg(self))
+
                 # Change directory to the root of the image so that we can
                 # remove any directories beneath us.  If we're changing the
                 # image, don't chdir, as we're likely changing to a new BE
@@ -858,10 +865,6 @@
                         # Configuration shouldn't be written again unless this
                         # is an image creation operation (hence the purge).
                         self.save_config()
-                else:
-                        # If not saving configuration, transport caches need
-                        # to be reset first.
-                        self.transport.cfg.reset_caches()
 
                 # load image avoid pkg set
                 self.__avoid_set_load()