From ed8b79683b3a2e5422216a0cf6db47dd4526622b Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Wed, 14 May 2014 02:03:20 -0400 Subject: [PATCH] relocate create.outdir to conf module Change-Id: I1a9007e9b3d8abfa91091ab063f75bb1f6cd3808 Signed-off-by: Gui Chen --- mic/conf.py | 5 +++++ mic/imager/baseimager.py | 1 - plugins/imager/fs_plugin.py | 6 ------ plugins/imager/livecd_plugin.py | 4 ---- plugins/imager/liveusb_plugin.py | 4 ---- plugins/imager/loop_plugin.py | 6 ------ plugins/imager/raw_plugin.py | 5 ----- 7 files changed, 5 insertions(+), 26 deletions(-) diff --git a/mic/conf.py b/mic/conf.py index 24e5d4e..a9e77a8 100644 --- a/mic/conf.py +++ b/mic/conf.py @@ -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:") diff --git a/mic/imager/baseimager.py b/mic/imager/baseimager.py index f50a4e9..3bd48a8 100644 --- a/mic/imager/baseimager.py +++ b/mic/imager/baseimager.py @@ -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", diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py index a97fae4..9687630 100644 --- a/plugins/imager/fs_plugin.py +++ b/plugins/imager/fs_plugin.py @@ -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') diff --git a/plugins/imager/livecd_plugin.py b/plugins/imager/livecd_plugin.py index 35ff512..13e57bb 100644 --- a/plugins/imager/livecd_plugin.py +++ b/plugins/imager/livecd_plugin.py @@ -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') diff --git a/plugins/imager/liveusb_plugin.py b/plugins/imager/liveusb_plugin.py index bc2b9aa..e0093dc 100644 --- a/plugins/imager/liveusb_plugin.py +++ b/plugins/imager/liveusb_plugin.py @@ -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') diff --git a/plugins/imager/loop_plugin.py b/plugins/imager/loop_plugin.py index 3641ec9..901ed9d 100644 --- a/plugins/imager/loop_plugin.py +++ b/plugins/imager/loop_plugin.py @@ -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') diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index d091138..2543b90 100644 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -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') -- 2.7.4