From 21dd3e20a7c690c66f657aaf66161a569d7702c7 Mon Sep 17 00:00:00 2001 From: andyjp94 Date: Fri, 1 Apr 2016 15:47:59 +0100 Subject: [PATCH] Change -vars-file to -var-file Changed vars_file to var_file to bring it into line with packer syntax, documentation will also need updating. Will submit a pull request for that in a second --- packer/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packer/__init__.py b/packer/__init__.py index dbd8161..cc4a24a 100644 --- a/packer/__init__.py +++ b/packer/__init__.py @@ -12,17 +12,17 @@ class Packer(): """Packer interface using the `sh` module (http://amoffat.github.io/sh/) """ def __init__(self, packerfile, exc=None, only=None, vars=None, - vars_file=None, exec_path=DEFAULT_PACKER_PATH): + var_file=None, exec_path=DEFAULT_PACKER_PATH): """ :param string packerfile: Path to Packer template file :param list exc: List of builders to exclude :param list only: List of builders to include :param dict vars: Key Value pairs of template variables - :param string vars_file: Path to variables file + :param string var_file: Path to variables file :param string exec_path: Path to Packer executable """ self.packerfile = self._validate_argtype(packerfile, str) - self.vars_file = vars_file + self.var_file = var_file if not os.path.isfile(self.packerfile): raise OSError('packerfile not found at path: {0}'.format( self.packerfile)) @@ -157,7 +157,7 @@ def _validate_argtype(self, arg, argtype): def _append_base_arguments(self): """Appends base arguments to packer commands. - -except, -only, -var and -vars-file are appeneded to almost + -except, -only, -var and -var-file are appeneded to almost all subcommands in packer. As such this can be called to add these flags to the subcommand. """ @@ -169,8 +169,8 @@ def _append_base_arguments(self): self._add_opt('-only={0}'.format(self._joinc(self.only))) for var, value in self.vars.items(): self._add_opt("-var '{0}={1}'".format(var, value)) - if self.vars_file: - self._add_opt('-vars-file={0}'.format(self.vars_file)) + if self.var_file: + self._add_opt('-var-file={0}'.format(self.var_file)) def _joinc(self, lst): """Returns a comma delimited string from a list"""