Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit d4524e3

Browse files
committed
Merge pull request #4 from andyjp94/patch-1
Change -vars-file to -var-file
2 parents 4c19863 + 21dd3e2 commit d4524e3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packer/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ class Packer():
1212
"""Packer interface using the `sh` module (http://amoffat.github.io/sh/)
1313
"""
1414
def __init__(self, packerfile, exc=None, only=None, vars=None,
15-
vars_file=None, exec_path=DEFAULT_PACKER_PATH):
15+
var_file=None, exec_path=DEFAULT_PACKER_PATH):
1616
"""
1717
:param string packerfile: Path to Packer template file
1818
:param list exc: List of builders to exclude
1919
:param list only: List of builders to include
2020
:param dict vars: Key Value pairs of template variables
21-
:param string vars_file: Path to variables file
21+
:param string var_file: Path to variables file
2222
:param string exec_path: Path to Packer executable
2323
"""
2424
self.packerfile = self._validate_argtype(packerfile, str)
25-
self.vars_file = vars_file
25+
self.var_file = var_file
2626
if not os.path.isfile(self.packerfile):
2727
raise OSError('packerfile not found at path: {0}'.format(
2828
self.packerfile))
@@ -157,7 +157,7 @@ def _validate_argtype(self, arg, argtype):
157157
def _append_base_arguments(self):
158158
"""Appends base arguments to packer commands.
159159
160-
-except, -only, -var and -vars-file are appeneded to almost
160+
-except, -only, -var and -var-file are appeneded to almost
161161
all subcommands in packer. As such this can be called to add
162162
these flags to the subcommand.
163163
"""
@@ -169,8 +169,8 @@ def _append_base_arguments(self):
169169
self._add_opt('-only={0}'.format(self._joinc(self.only)))
170170
for var, value in self.vars.items():
171171
self._add_opt("-var '{0}={1}'".format(var, value))
172-
if self.vars_file:
173-
self._add_opt('-vars-file={0}'.format(self.vars_file))
172+
if self.var_file:
173+
self._add_opt('-var-file={0}'.format(self.var_file))
174174

175175
def _joinc(self, lst):
176176
"""Returns a comma delimited string from a list"""

0 commit comments

Comments
 (0)