Revert "Added params needed for Atomic compose to LoraxWrapper"

This reverts commit 919a4fc619.
This commit is contained in:
Dennis Gilmore 2015-09-04 12:12:36 -05:00
parent d982cd585f
commit da0405a0f5
2 changed files with 2 additions and 67 deletions

View File

@ -86,12 +86,6 @@ class BuildinstallPhase(PhaseBase):
noupgrade = not self.compose.conf.get("buildinstall_upgrade_image", False)
buildinstall_method = self.compose.conf["buildinstall_method"]
# These were added for the Atomic ISO Lorax compose
add_template = self.compose.conf.get("add_template", None)
add_template_var = self.compose.conf.get("add_template_var", None)
add_arch_template = self.compose.conf.get("add_arch_template", None)
add_arch_template_var = self.compose.conf.get("add_arch_template_var", None)
for arch in self.compose.get_arches():
repo_baseurl = self.compose.paths.work.arch_repo(arch)
output_dir = self.compose.paths.work.buildinstall_dir(arch)
@ -99,7 +93,7 @@ class BuildinstallPhase(PhaseBase):
buildarch = get_valid_arches(arch)[0]
if buildinstall_method == "lorax":
cmd = lorax.get_lorax_cmd(product, version, release, repo_baseurl, output_dir, is_final=self.compose.supported, buildarch=buildarch, volid=volid, nomacboot=True, noupgrade=noupgrade, add_template=add_template, add_template_var=add_template_var, add_arch_template=add_arch_template, add_template_var=add_template_var)
cmd = lorax.get_lorax_cmd(product, version, release, repo_baseurl, output_dir, is_final=self.compose.supported, buildarch=buildarch, volid=volid, nomacboot=True, noupgrade=noupgrade)
elif buildinstall_method == "buildinstall":
cmd = lorax.get_buildinstall_cmd(product, version, release, repo_baseurl, output_dir, is_final=self.compose.supported, buildarch=buildarch, volid=volid)
else:

View File

@ -21,40 +21,7 @@ from kobo.shortcuts import force_list
class LoraxWrapper(object):
def _handle_optional_arg_type(self, f_arg, c_arg):
"""
_handle_optional_arg_type
private function to handle arguments to LoraxWrapper get_*_cmd
functions that can optionally be different types (such as string
or list). This effectively allows to repeat args to the commands
wrapped by LoraxWrapper.
@param uknown type : f_arg
- Function argument that is passed to the get_*_cmd function.
@param string: c_arg
- Command line argument to append to cmd
@return list
- returns a list of strings to join with the cmd list in the get_*_cmd
functions
"""
cmd_args = []
if type(f_arg) is list:
for item in f_arg:
cmd_args.append("%s=%s" % (c_arg, item))
if type(f_arg) is str:
cmd_args.append("%s=%s" % (c_arg, item))
else:
raise Exception(
f_arg,
"Incorrect type passed to LoraxWrapper for " % c_arg
)
return cmd_args
def get_lorax_cmd(self, product, version, release, repo_baseurl, output_dir, variant=None, bugurl=None, nomacboot=False, noupgrade=False, is_final=False, buildarch=None, volid=None, add_template=None, add_template_var=None, add_arch_template=None, add_arch_template_var=None):
def get_lorax_cmd(self, product, version, release, repo_baseurl, output_dir, variant=None, bugurl=None, nomacboot=False, noupgrade=False, is_final=False, buildarch=None, volid=None):
cmd = ["lorax"]
cmd.append("--product=%s" % product)
cmd.append("--version=%s" % version)
@ -86,32 +53,6 @@ class LoraxWrapper(object):
if volid:
cmd.append("--volid=%s" % volid)
if add_template:
cmd.extend(
self._handle_optional_arg_type(add_template, "--add-template")
)
if add_template_var:
cmd.extend(
self._handle_optional_arg_type(
add_template_var, "--add-template-var"
)
)
if add_arch_template:
cmd.extend(
self._handle_optional_arg_type(
add_arch_template, "--add-arch-template"
)
)
if add_arch_template_var:
cmd.extend(
self._handle_optional_arg_type(
add_arch_template_var, "--add-arch-template-var"
)
)
output_dir = os.path.abspath(output_dir)
cmd.append(output_dir)