relocate create.outdir to conf module
authorGui Chen <gui.chen@intel.com>
Wed, 14 May 2014 06:03:20 +0000 (02:03 -0400)
committerGui Chen <gui.chen@intel.com>
Mon, 9 Jun 2014 05:39:49 +0000 (01:39 -0400)
Change-Id: I1a9007e9b3d8abfa91091ab063f75bb1f6cd3808
Signed-off-by: Gui Chen <gui.chen@intel.com>
Conflicts:
plugins/imager/fs_plugin.py
plugins/imager/raw_plugin.py

mic/conf.py
mic/imager/baseimager.py
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 24e5d4e..a9e77a8 100644 (file)
@@ -43,6 +43,7 @@ class ConfigMgr(object):
                     "tmpdir": '/var/tmp/mic',
                     "cachedir": '/var/tmp/mic/cache',
                     "outdir": './mic-output',
+                    "destdir": None,
                     "arch": None, # None means auto-detect
                     "pkgmgr": "auto",
                     "name": "output",
@@ -201,7 +202,11 @@ class ConfigMgr(object):
                                               self.create['name_prefix'],
                                               self.create['name_suffix'])
 
+        self.create['destdir'] = self.create['outdir']
         if self.create['release'] is not None:
+            self.create['destdir'] = "%s/%s/images/%s/" % (self.create['outdir'],
+                                                           self.create['release'],
+                                                           self.create['name'])
             self.create['name'] = self.create['release'] + '_' + self.create['name']
 
         msger.info("Retrieving repo metadata:")
index 59086f5..ab781b9 100644 (file)
@@ -89,7 +89,6 @@ class BaseImageCreator(object):
         if createopts:
             # Mapping table for variables that have different names.
             optmap = {"pkgmgr" : "pkgmgr_name",
-                      "outdir" : "destdir",
                       "arch" : "target_arch",
                       "local_pkgs_path" : "_local_pkgs_path",
                       "copy_kernel" : "_need_copy_kernel",
index 3333157..28ec970 100644 (file)
@@ -75,10 +75,6 @@ class FsPlugin(ImagerPlugin):
 
         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
         backends = pluginmgr.get_plugins('backend')
index 0ccba72..7d17d85 100644 (file)
@@ -75,10 +75,6 @@ class LiveCDPlugin(ImagerPlugin):
 
         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
         backends = pluginmgr.get_plugins('backend')
index 297a9b0..0c80acc 100644 (file)
@@ -77,10 +77,6 @@ class LiveUSBPlugin(ImagerPlugin):
 
         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
         backends = pluginmgr.get_plugins('backend')
index 30dc3d9..8b4dcaf 100644 (file)
@@ -80,12 +80,6 @@ class LoopPlugin(ImagerPlugin):
 
         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
         backends = pluginmgr.get_plugins('backend')
index 25409a9..2dfa8e7 100644 (file)
@@ -86,10 +86,6 @@ class RawPlugin(ImagerPlugin):
 
         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
         backends = pluginmgr.get_plugins('backend')