Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 14 commits
  • 17 files changed
  • 0 commit comments
  • 4 contributors
Commits on Dec 14, 2011
Marko Saukko Fix typos in messages.
Signed-off-by: Marko Saukko <marko.saukko@cybercom.com>
0f53218
Commits on Dec 15, 2011
Marko Saukko Added mic/__version__.py, build/, dist/ and mic.egg-info/ to ignore l…
…ist.

Removed micng/__version__.py from .gitignore.
fbe2026
Marko Saukko Reintroduced the compress-disk-image option from mic2.
Signed-off-by: Marko Saukko <marko.saukko@cybercom.com>
3afbf9e
@jfding jfding Merge pull request #2 from saukko/master
some minor typos in error messages.
2ce25c4
Marko Saukko Remove hardcoded distro name.
Signed-off-by: Marko Saukko <marko.saukko@cybercom.com>
6d189fc
Marko Saukko Added support for name_prefix.
Signed-off-by: Marko Saukko <marko.saukko@cybercom.com>
959f66e
Marko Saukko Don't create new name value as we have already done one during the co…
…nfig and .ks file parsing.

Signed-off-by: Marko Saukko <marko.saukko@cybercom.com>
ec03ff6
Commits on Dec 16, 2011
@jfding jfding cleanup all trailing spaces in code 9209316
@jfding jfding Merge pull request #3 from bartosh/master
Implemented repository option --ssl_verify
ee47d0e
@xiaoqiang0 xiaoqiang0 Added priority and cost option for repos 777c539
@jfding jfding Merge pull request #6 from xiaoqiang0/master
Added priority/cost repo option support
abc86d9
Marko Saukko Merge branch 'master' of https://github.com/jfding/mic
Conflicts:
	distfiles/mic.conf
9a40deb
@jfding jfding Merge pull request #4 from saukko/master
Some updates for naming
d5eb88e
@bart0sh bart0sh Reformatted according to PEP08. Removed unused import. e6d8f30
View
5 .gitignore
@@ -1,4 +1,7 @@
*.py[oc]
*~
*.swp
-micng/__version__.py
+mic/__version__.py
+build/
+dist/
+mic.egg-info/
View
4 README.rst
@@ -145,7 +145,7 @@ to process the installation.
Configuration file
==================
The configure file for mic can be provided as `/etc/mic/mic.conf`, where you
-can specify the global settings.
+can specify the global settings.
The blow is the content of one sample file: ::
[common]
@@ -169,7 +169,7 @@ The blow is the content of one sample file: ::
; settings for chroot subcommand
In this configuration file, there are four sections: [common] is for general
-setting, and [create] [convert] [chroot] sections are for the options of
+setting, and [create] [convert] [chroot] sections are for the options of
corresponding mic subcommands: create, convert, and chroot.
In the [create] section, the following values can be specified:
View
3  distfiles/mic.conf
@@ -7,9 +7,12 @@ tmpdir= /var/tmp/mic
cachedir= /var/tmp/mic/cache
outdir= ./mic-output
pkgmgr = zypp
+distro_name = Tizen
; proxy = http://proxy.yourcompany.com:8080/
; no_proxy = localhost,127.0.0.0/8,.yourcompany.com
+# Prefix that is added in front of files that are produced.
+; name_prefix = output
; ssl_verify = no
[convert]
View
41 mic/conf.py
@@ -15,7 +15,7 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-import os, sys
+import os
import ConfigParser
import msger
@@ -40,6 +40,9 @@ class ConfigMgr(object):
"release": None,
"logfile": None,
"record_pkgs": [],
+ "compress_disk_image": None,
+ "distro_name": "Default Distribution",
+ "name_prefix": None,
},
'chroot': {},
'convert': {},
@@ -94,7 +97,8 @@ def _parse_siteconf(self, siteconf):
return
if not os.path.exists(siteconf):
- raise errors.ConfigError("Failed to find config file: %s" % siteconf)
+ raise errors.ConfigError("Failed to find config file: %s" \
+ % siteconf)
parser = ConfigParser.SafeConfigParser()
parser.read(siteconf)
@@ -104,8 +108,10 @@ def _parse_siteconf(self, siteconf):
getattr(self, section).update(dict(parser.items(section)))
def _selinux_check(self, arch, ks):
- """ If a user needs to use btrfs or creates ARM image, selinux must be disabled at start """
-
+ """
+ If a user needs to use btrfs or creates ARM image,
+ selinux must be disabled at start.
+ """
for path in ["/usr/sbin/getenforce",
"/usr/bin/getenforce",
"/sbin/getenforce",
@@ -115,19 +121,21 @@ def _selinux_check(self, arch, ks):
]:
if os.path.exists(path):
selinux_status = runner.outs([path])
- if arch and arch.startswith("arm") and selinux_status == "Enforcing":
- raise errors.ConfigError("Can't create arm image if selinux is enabled, please disbale it and try again")
+ if arch and arch.startswith("arm") \
+ and selinux_status == "Enforcing":
+ raise errors.ConfigError("Can't create arm image if "\
+ "selinux is enabled, please disable it and try again")
use_btrfs = False
- parts = ks.handler.partition.partitions
for part in ks.handler.partition.partitions:
if part.fstype == "btrfs":
use_btrfs = True
break
if use_btrfs and selinux_status == "Enforcing":
- raise errors.ConfigError("Can't create image useing btrfs filesystem if selinux is enabled, please disbale it and try again")
-
+ raise errors.ConfigError("Can't create image using btrfs "\
+ "filesystem if selinux is enabled, "\
+ "please disable it and try again")
break
def _parse_kickstart(self, ksconf=None):
@@ -139,25 +147,32 @@ def _parse_kickstart(self, ksconf=None):
self.create['ks'] = ks
self.create['name'] = os.path.splitext(os.path.basename(ksconf))[0]
+ if self.create['name_prefix']:
+ self.create['name'] = "%s-%s" % (self.create['name_prefix'],
+ self.create['name'])
+
self._selinux_check (self.create['arch'], ks)
msger.info("Retrieving repo metadata:")
ksrepos = misc.get_repostrs_from_ks(ks)
- self.create['repomd'] = misc.get_metadata_from_repos(ksrepos, self.create['cachedir'])
+ self.create['repomd'] = misc.get_metadata_from_repos(ksrepos,
+ self.create['cachedir'])
msger.raw(" DONE")
target_archlist, archlist = misc.get_arch(self.create['repomd'])
if self.create['arch']:
if self.create['arch'] not in archlist:
- raise errors.ConfigError("Invalid arch %s for repository. Valid arches: %s"\
- % (self.create['arch'], ', '.join(archlist)))
+ raise errors.ConfigError("Invalid arch %s for repository. "\
+ "Valid arches: %s" % (self.create['arch'],
+ ', '.join(archlist)))
else:
if len(target_archlist) == 1:
self.create['arch'] = str(target_archlist[0])
msger.info("\nUse detected arch %s." % target_archlist[0])
else:
raise errors.ConfigError("Please specify a valid arch, "\
- "your choise can be: %s" % ', '.join(archlist))
+ "your choise can be: %s" \
+ % ', '.join(archlist))
kickstart.resolve_groups(self.create, self.create['repomd'])
View
4 mic/creator.py
@@ -62,6 +62,7 @@ def get_optparser(self):
help='Record the info of installed packages, multiple values can be specified which joined by ",", valid values: "name", "content", "license"')
optparser.add_option('', '--pkgmgr', type='string', dest='pkgmgr', default=None, help='Specify backend package manager')
optparser.add_option('', '--local-pkgs-path', type='string', dest='local_pkgs_path', default=None, help='Path for local pkgs(rpms) to be installed')
+ optparser.add_option('', '--compress-disk-image', type='string', dest='compress_disk_image', default=None, help='Sets the disk image compression. NOTE: The available values might depend on the used filesystem type.')
return optparser
def preoptparse(self, argv):
@@ -147,6 +148,9 @@ def postoptparse(self):
if self.options.pkgmgr is not None:
configmgr.create['pkgmgr'] = self.options.pkgmgr
+ if self.options.compress_disk_image is not None:
+ configmgr.create['compress_disk_image'] = self.options.compress_disk_image
+
def main(self, argv=None):
if argv is None:
argv = sys.argv
View
55 mic/imager/baseimager.py
@@ -63,6 +63,14 @@ def __init__(self, createopts = None, pkgmgr = None):
self.__builddir = None
self.__bindmounts = []
+ # Eeach image type can change these values as they might be image type
+ # specific
+ if not hasattr(self, "_valid_compression_methods"):
+ self._valid_compression_methods = ['bz2']
+
+ # The compression method for disk image.
+ self._img_compression_method = None
+
if createopts:
# A pykickstart.KickstartParser instance."""
self.ks = createopts['ks']
@@ -88,6 +96,7 @@ def __init__(self, createopts = None, pkgmgr = None):
self.cachedir = createopts['cachedir']
self.target_arch = createopts['arch']
self._local_pkgs_path = createopts['local_pkgs_path']
+ self._img_compression_method = createopts['compress_disk_image']
else:
self.ks = None
@@ -100,37 +109,32 @@ def __init__(self, createopts = None, pkgmgr = None):
self._dep_checks = ["ls", "bash", "cp", "echo", "modprobe", "passwd"]
- #FIXME to be obsolete, make it configurable
- self.distro_name = "Tizen"
+ self.distro_name = createopts['distro_name']
- # Output image file names"""
+ # Output image file names
self.outimage = []
- # A flag to generate checksum"""
+ # A flag to generate checksum
self._genchecksum = False
self._alt_initrd_name = None
- # the disk image after creation, e.g., bz2.
- # This value is set with compression_method function. """
- self.__img_compression_method = None
-
self._recording_pkgs = []
# available size in root fs, init to 0
self._root_fs_avail = 0
- # Name of the disk image file that is created. """
+ # Name of the disk image file that is created.
self._img_name = None
self.image_format = None
- # Save qemu emulator file name in order to clean up it finally """
+ # Save qemu emulator file name in order to clean up it finally
self.qemu_emulator = None
- # No ks provided when called by convertor, so skip the dependency check """
+ # No ks provided when called by convertor, so skip the dependency check
if self.ks:
- # If we have btrfs partition we need to check that we have toosl for those """
+ # If we have btrfs partition we need to check that we have toosl for those
for part in self.ks.handler.partition.partitions:
if part.fstype and part.fstype == "btrfs":
self._dep_checks.append("mkfs.btrfs")
@@ -159,6 +163,9 @@ def __init__(self, createopts = None, pkgmgr = None):
if not os.path.exists(self.cachedir):
os.makedirs(self.cachedir)
+ if self._img_compression_method != None and self._img_compression_method not in self._valid_compression_methods:
+ raise CreatorError("Given disk image compression method ('%s') is not valid. Valid values are '%s'." % (self._img_compression_method, ' '.join(self._valid_compression_methods)))
+
def __del__(self):
self.cleanup()
@@ -831,10 +838,11 @@ def install(self, repo_urls = {}):
for repo in kickstart.get_repos(self.ks, repo_urls):
(name, baseurl, mirrorlist, inc, exc,
proxy, proxy_username, proxy_password, debuginfo,
- source, gpgkey, disable, ssl_verify) = repo
+ source, gpgkey, disable, ssl_verify, cost, priority) = repo
yr = pkg_manager.addRepository(name, baseurl, mirrorlist, proxy,
- proxy_username, proxy_password, inc, exc, ssl_verify)
+ proxy_username, proxy_password, inc, exc, ssl_verify,
+ cost, priority)
if kickstart.exclude_docs(self.ks):
rpm.addMacro("_excludedocs", "1")
@@ -1001,22 +1009,22 @@ def package(self, destdir = "."):
if not os.path.exists(destdir):
fs.makedirs(destdir)
- if self.__img_compression_method:
+ if self._img_compression_method:
if not self._img_name:
raise CreatorError("Image name not set.")
rc = None
img_location = os.path.join(self._outdir,self._img_name)
- if self.__img_compression_method == "bz2":
+ if self._img_compression_method == "bz2":
bzip2 = fs.find_binary_path('bzip2')
msger.info("Compressing %s with bzip2. Please wait..." % img_location)
rc = runner.show([bzip2, "-f", img_location])
if rc:
- raise CreatorError("Failed to compress image %s with %s." % (img_location, self.__img_compression_method))
+ raise CreatorError("Failed to compress image %s with %s." % (img_location, self._img_compression_method))
for bootimg in glob.glob(os.path.dirname(img_location) + "/*-boot.bin"):
msger.info("Compressing %s with bzip2. Please wait..." % bootimg)
rc = runner.show([bzip2, "-f", bootimg])
if rc:
- raise CreatorError("Failed to compress image %s with %s." % (bootimg, self.__img_compression_method))
+ raise CreatorError("Failed to compress image %s with %s." % (bootimg, self._img_compression_method))
if self._recording_pkgs:
self._save_recording_pkgs(destdir)
@@ -1140,16 +1148,5 @@ def save_kernel(self, destdir):
shutil.copy(kernel, kernelfilename)
self.outimage.append(kernelfilename)
- def compress_disk_image(self, compression_method):
- """
- With this you can set the method that is used to compress the disk
- image after it is created.
- """
-
- if compression_method not in ('bz2'):
- raise CreatorError("Given disk image compression method ('%s') is not valid." % (compression_method))
-
- self.__img_compression_method = compression_method
-
def get_pkg_manager(self):
return self.pkgmgr(creator = self)
View
45 mic/imager/fs.py
@@ -20,27 +20,58 @@
from baseimager import BaseImageCreator
from mic import msger
from mic.utils import runner
+from mic.utils.fs_related import *
+from subprocess import call
class FsImageCreator(BaseImageCreator):
def __init__(self, cfgmgr = None, pkgmgr = None):
+ self._valid_compression_methods = ["tar.bz2"]
BaseImageCreator.__init__(self, cfgmgr, pkgmgr)
self._fstype = None
self._fsopts = None
self._include_src = False
def package(self, destdir = "."):
+
+ ignores = ["/dev/fd", "/dev/stdin", "/dev/stdout", "/dev/stderr", "/etc/mtab"]
+
if not os.path.exists(destdir):
os.makedirs(destdir)
- fsdir = os.path.join(destdir, self.name)
if self._recording_pkgs:
self._save_recording_pkgs(destdir)
- msger.info("Copying %s to %s ..." % (self._instroot, fsdir))
- runner.show(['cp', "-af", self._instroot, fsdir])
+ if self._img_compression_method == None:
+ fsdir = os.path.join(destdir, self.name)
+
+ msger.info("Copying %s to %s ..." % (self._instroot, fsdir))
+ runner.show(['cp', "-af", self._instroot, fsdir])
+
+ for exclude in ignores:
+ if os.path.exists(fsdir + exclude):
+ os.unlink(fsdir + exclude)
+
+ self.outimage.append(fsdir)
+
+ elif self._img_compression_method == "tar.bz2":
+ dst = "%s/%s.tar.bz2" % (destdir, self.name)
+ msger.info("Creating %s (compressing %s with %s). Please wait..." % (dst, self._instroot, self._img_compression_method))
+
+ tar = find_binary_path('tar')
+ tar_cmdline = [tar, "--numeric-owner", "--preserve-permissions", "--preserve-order", "--one-file-system", "--directory", self._instroot]
+ for ignore_entry in ignores:
+ if ignore_entry.startswith('/'):
+ ignore_entry = ignore_entry[1:]
+
+ tar_cmdline.append("--exclude=%s" % (ignore_entry))
+
+ tar_cmdline.extend(["-cjf", dst, "."])
+
+ rc = call(tar_cmdline)
+ if rc:
+ raise CreatorError("Failed compress image with tar.bz2. Cmdline: %s" % (" ".join(tar_cmdline)))
- for exclude in ["/dev/fd", "/dev/stdin", "/dev/stdout", "/dev/stderr", "/etc/mtab"]:
- if os.path.exists(fsdir + exclude):
- os.unlink(fsdir + exclude)
+ self.outimage.append(dst)
- self.outimage.append(fsdir)
+ else:
+ raise CreatorError("Compression method '%s' not supported for 'fs' image format." % (self._img_compression_method))
View
8 mic/kickstart/__init__.py
@@ -688,10 +688,16 @@ def get_repos(ks, repo_urls = {}):
ssl_verify = True
if hasattr(repo, "ssl_verify"):
ssl_verify = repo.ssl_verify == "yes"
+ cost = None
+ if hasattr(repo, "cost"):
+ cost = repo.cost
+ priority = None
+ if hasattr(repo, "priority"):
+ priority = repo.priority
repos[repo.name] = (repo.name, baseurl, mirrorlist, inc, exc,
proxy, proxy_username, proxy_password, debuginfo,
- source, gpgkey, disable, ssl_verify)
+ source, gpgkey, disable, ssl_verify, cost, priority)
return repos.values()
View
5 mic/kickstart/custom_commands/moblinrepo.py
@@ -39,6 +39,7 @@ def __init__(self, baseurl="", mirrorlist="", name="", priority=None,
self.source = source
self.gpgkey = gpgkey
self.ssl_verify = ssl_verify.lower()
+ self.priority = priority
def _getArgsAsStr(self):
retval = F8_RepoData._getArgsAsStr(self)
@@ -61,6 +62,8 @@ def _getArgsAsStr(self):
retval += " --disable"
if self.ssl_verify:
retval += " --ssl_verify=%s" % self.ssl_verify
+ if self.priority:
+ retval += " --priority=%s" % self.priority
return retval
@@ -99,4 +102,6 @@ def list_cb (option, opt_str, value, parser):
default=None, nargs=1)
op.add_option("--ssl_verify", type="string", action="store", dest="ssl_verify",
default="yes")
+ op.add_option("--priority", type="int", action="store", dest="priority",
+ default=None)
return op
View
4 mic/utils/misc.py
@@ -223,10 +223,12 @@ def get_repostrs_from_ks(ks):
repostr += ",debuginfo:"
if hasattr(repodata, "source") and repodata.source:
repostr += ",source:"
- if hasattr(repodata, "gpgkey") and repodata.gpgkey:
+ if hasattr(repodata, "gpgkey") and repodata.gpgkey:
repostr += ",gpgkey:" + repodata.gpgkey
if hasattr(repodata, "ssl_verify") and repodata.ssl_verify:
repostr += ",ssl_verify:" + repodata.ssl_verify
+ if hasattr(repodata, "priority") and repodata.priority:
+ repostr += ",priority:%d" % repodata.priority
kickstart_repos.append(repostr[1:])
return kickstart_repos
View
6 plugins/backend/yumpkgmgr.py
@@ -190,7 +190,9 @@ def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT):
def addRepository(self, name, url = None, mirrorlist = None, proxy = None,
proxy_username = None, proxy_password = None,
- inc = None, exc = None, ssl_verify=True):
+ inc = None, exc = None, ssl_verify=True, cost = None,
+ priority=None):
+ # TODO: Handle priority attribute for repos
def _varSubstitute(option):
# takes a variable and substitutes like yum configs do
option = option.replace("$basearch", rpmUtils.arch.getBaseArch())
@@ -231,6 +233,8 @@ def _varSubstitute(option):
repo.enable()
repo.setup(0)
self.repos.add(repo)
+ if cost:
+ repo.cost = cost
msger.verbose('repo: %s was added' % name)
return repo
View
11 plugins/backend/zypppkgmgr.py
@@ -45,6 +45,7 @@ def __init__(self):
self.enabled = True
self.autorefresh = True
self.keeppackages = True
+ self.priority = None
class RepoError(CreatorError):
pass
@@ -145,7 +146,7 @@ def markPoolItem(obs, pi):
pi.status().setToBeInstalled (zypp.ResStatus.USER)
else:
obs.status().setToBeInstalled (zypp.ResStatus.USER)
-
+
found = False
startx = pkg.startswith("*")
endx = pkg.endswith("*")
@@ -251,7 +252,9 @@ def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT):
def addRepository(self, name, url = None, mirrorlist = None, proxy = None,
proxy_username = None, proxy_password = None,
- inc = None, exc = None, ssl_verify = True):
+ inc = None, exc = None, ssl_verify = True, cost=None,
+ priority=None):
+ # TODO: Handle cost attribute for repos
if not self.repo_manager:
self.__initialize_repo_manager()
@@ -280,6 +283,8 @@ def addRepository(self, name, url = None, mirrorlist = None, proxy = None,
# Enable gpg check for verifying corrupt packages
repo.gpgcheck = 1
+ if priority:
+ repo.priority = priority
self.repos.append(repo)
try:
@@ -301,6 +306,8 @@ def addRepository(self, name, url = None, mirrorlist = None, proxy = None,
port = proxyinfo[1]
baseurl.setQueryParam ("proxyport", port)
repo_info.addBaseUrl(baseurl)
+ if repo.priority:
+ repo_info.setPriority(repo.priority)
self.repo_manager.addRepository(repo_info)
self.__build_repo_cache(name)
except RuntimeError, e:
View
8 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
View
8 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
View
8 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
View
8 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
View
8 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

No commit comments for this range

Something went wrong with that request. Please try again.