From ec03ff608750a5f1e50bcc82f72289187a1dfdc6 Mon Sep 17 00:00:00 2001 From: Marko Saukko Date: Thu, 15 Dec 2011 13:53:55 +0200 Subject: [PATCH] Don't create new name value as we have already done one during the config and .ks file parsing. Signed-off-by: Marko Saukko --- plugins/imager/fs_plugin.py | 8 ++++++-- plugins/imager/livecd_plugin.py | 8 ++++++-- plugins/imager/liveusb_plugin.py | 8 ++++++-- plugins/imager/loop_plugin.py | 8 ++++++-- plugins/imager/raw_plugin.py | 8 ++++++-- 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py index eb7dab5..72d3ff4 100644 --- a/plugins/imager/fs_plugin.py +++ b/plugins/imager/fs_plugin.py @@ -51,13 +51,17 @@ def do_create(self, subcmd, opts, *args): 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 diff --git a/plugins/imager/livecd_plugin.py b/plugins/imager/livecd_plugin.py index ade1821..8f8db22 100644 --- a/plugins/imager/livecd_plugin.py +++ b/plugins/imager/livecd_plugin.py @@ -56,13 +56,17 @@ def do_create(self, subcmd, opts, *args): 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 diff --git a/plugins/imager/liveusb_plugin.py b/plugins/imager/liveusb_plugin.py index 7b420c6..c9e76bb 100644 --- a/plugins/imager/liveusb_plugin.py +++ b/plugins/imager/liveusb_plugin.py @@ -58,13 +58,17 @@ def do_create(self, subcmd, opts, *args): 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 diff --git a/plugins/imager/loop_plugin.py b/plugins/imager/loop_plugin.py index dd4b7bf..144086e 100644 --- a/plugins/imager/loop_plugin.py +++ b/plugins/imager/loop_plugin.py @@ -53,13 +53,17 @@ def do_create(self, subcmd, opts, *args): 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 diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index dbf060f..7146632 100644 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -55,13 +55,17 @@ def do_create(self, subcmd, opts, *args): 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