Don't create new name value as we have already done one during the config and .ks...
authorMarko Saukko <marko.saukko@cybercom.com>
Thu, 15 Dec 2011 11:53:55 +0000 (13:53 +0200)
committerMarko Saukko <marko.saukko@cybercom.com>
Thu, 15 Dec 2011 11:53:55 +0000 (13:53 +0200)
Signed-off-by: Marko Saukko <marko.saukko@cybercom.com>
plugins/imager/fs_plugin.py
plugins/imager/livecd_plugin.py
plugins/imager/liveusb_plugin.py
plugins/imager/loop_plugin.py
plugins/imager/raw_plugin.py

index eb7dab5..72d3ff4 100644 (file)
@@ -51,13 +51,17 @@ class FsPlugin(ImagerPlugin):
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
             recording_pkgs = creatoropts['record_pkgs']
+        
         if creatoropts['release'] is not None:
             if 'name' not in recording_pkgs:
                 recording_pkgs.append('name')
             ksconf = misc.save_ksconf_file(ksconf, creatoropts['release'])
-            name = os.path.splitext(os.path.basename(ksconf))[0]
-            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], name)
+
         configmgr._ksconf = ksconf
+    
+        # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
+        if creatoropts['release'] is not None:
+            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
 
         # try to find the pkgmgr
         pkgmgr = None
index ade1821..8f8db22 100644 (file)
@@ -56,13 +56,17 @@ class LiveCDPlugin(ImagerPlugin):
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
             recording_pkgs = creatoropts['record_pkgs']
+
         if creatoropts['release'] is not None:
             if 'name' not in recording_pkgs:
                 recording_pkgs.append('name')
             ksconf = misc.save_ksconf_file(ksconf, creatoropts['release'])
-            name = os.path.splitext(os.path.basename(ksconf))[0]
-            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], name)
+
         configmgr._ksconf = ksconf
+    
+        # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
+        if creatoropts['release'] is not None:
+            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
 
         # try to find the pkgmgr
         pkgmgr = None
index 7b420c6..c9e76bb 100644 (file)
@@ -58,13 +58,17 @@ class LiveUSBPlugin(ImagerPlugin):
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
             recording_pkgs = creatoropts['record_pkgs']
+
         if creatoropts['release'] is not None:
             if 'name' not in recording_pkgs:
                 recording_pkgs.append('name')
             ksconf = misc.save_ksconf_file(ksconf, creatoropts['release'])
-            name = os.path.splitext(os.path.basename(ksconf))[0]
-            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], name)
+
         configmgr._ksconf = ksconf
+    
+        # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
+        if creatoropts['release'] is not None:
+            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
 
         # try to find the pkgmgr
         pkgmgr = None
index dd4b7bf..144086e 100644 (file)
@@ -53,13 +53,17 @@ class LoopPlugin(ImagerPlugin):
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
             recording_pkgs = creatoropts['record_pkgs']
+
         if creatoropts['release'] is not None:
             if 'name' not in recording_pkgs:
                 recording_pkgs.append('name')
             ksconf = misc.save_ksconf_file(ksconf, creatoropts['release'])
-            name = os.path.splitext(os.path.basename(ksconf))[0]
-            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], name)
+
         configmgr._ksconf = ksconf
+    
+        # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
+        if creatoropts['release'] is not None:
+            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
 
         # try to find the pkgmgr
         pkgmgr = None
index dbf060f..7146632 100644 (file)
@@ -55,13 +55,17 @@ class RawPlugin(ImagerPlugin):
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
             recording_pkgs = creatoropts['record_pkgs']
+
         if creatoropts['release'] is not None:
             if 'name' not in recording_pkgs:
                 recording_pkgs.append('name')
             ksconf = misc.save_ksconf_file(ksconf, creatoropts['release'])
-            name = os.path.splitext(os.path.basename(ksconf))[0]
-            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], name)
+
         configmgr._ksconf = ksconf
+    
+        # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
+        if creatoropts['release'] is not None:
+            creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
 
         # try to find the pkgmgr
         pkgmgr = None