From da0405a0f5547d46a6234dfb02bc0dd5bbdc66aa Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 4 Sep 2015 12:12:36 -0500 Subject: [PATCH] Revert "Added params needed for Atomic compose to LoraxWrapper" This reverts commit 919a4fc61913615f441a92b3d5f2b99a93eeea90. --- pungi/phases/buildinstall.py | 8 +---- pungi/wrappers/lorax.py | 61 +----------------------------------- 2 files changed, 2 insertions(+), 67 deletions(-) diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index 94f4be40..08ce03d0 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -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: diff --git a/pungi/wrappers/lorax.py b/pungi/wrappers/lorax.py index 724ddc32..80d7f9f8 100644 --- a/pungi/wrappers/lorax.py +++ b/pungi/wrappers/lorax.py @@ -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)