generic_stage_target.py: Fix an intermittent snapshot_cache_path keyerror
authorBrian Dolbec <dolsen@gentoo.org>
Sat, 11 Jan 2014 00:13:06 +0000 (16:13 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Wed, 2 Apr 2014 20:04:22 +0000 (13:04 -0700)
catalyst/targets/generic_stage_target.py

index 9c39d00834ff106d7f3a1c7ef21010b336119812..eaf2c1f7e7069ce5aebcf089febf47709086f666 100644 (file)
@@ -215,13 +215,14 @@ class generic_stage_target(generic_target):
                self.mountmap = SOURCE_MOUNTS_DEFAULTS.copy()
                # update them from settings
                self.mountmap["distdir"] = self.settings["distdir"]
-               self.mountmap["portdir"] = normpath("/".join([
-                       self.settings["snapshot_cache_path"],
-                       self.settings["repo_name"],
-                       ]))
                if "SNAPCACHE" not in self.settings:
                        self.mounts.remove("portdir")
-                       #self.mountmap["portdir"] = None
+                       self.mountmap["portdir"] = None
+               else:
+                       self.mountmap["portdir"] = normpath("/".join([
+                               self.settings["snapshot_cache_path"],
+                               self.settings["repo_name"],
+                               ]))
                if os.uname()[0] == "Linux":
                        self.mounts.append("devpts")
                        self.mounts.append("shm")