relocate create.outdir to conf module
authorGui Chen <gui.chen@intel.com>
Wed, 14 May 2014 06:03:20 +0000 (02:03 -0400)
committeradmin <yuhuan.yang@samsung.com>
Thu, 4 Feb 2016 10:08:44 +0000 (18:08 +0800)
Change-Id: I1a9007e9b3d8abfa91091ab063f75bb1f6cd3808
Signed-off-by: Gui Chen <gui.chen@intel.com>
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 f50a4e9..3bd48a8 100644 (file)
@@ -94,7 +94,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 a97fae4..9687630 100644 (file)
@@ -72,12 +72,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 35ff512..13e57bb 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 bc2b9aa..e0093dc 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 3641ec9..901ed9d 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 d091138..2543b90 100644 (file)
@@ -86,11 +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')