def __init__(self, packerfile, exc=None, only=None, vars=None,<EOL>var_file=None, exec_path=DEFAULT_PACKER_PATH, out_iter=None,<EOL>err_iter=None):
self.packerfile = self._validate_argtype(packerfile, str)<EOL>self.var_file = var_file<EOL>if not os.path.isfile(self.packerfile):<EOL><INDENT>raise OSError('<STR_LIT>'.format(<EOL>self.packerfile))<EOL><DEDENT>self.exc = self._validate_argtype(exc or [], list)<EOL>self.only = self._validate_argtype(only or [], list)<EOL>self.vars = self._validate_argtype(vars or {}, dict)<EOL>kwargs = dict()<EOL>if out_iter is not None:<EOL><INDENT>kwargs["<STR_LIT>"] = out_iter<EOL>kwargs["<STR_LIT>"] = <NUM_LIT:1><EOL><DEDENT>if err_iter is not None:<EOL><INDENT>kwargs["<STR_LIT>"] = err_iter<EOL>kwargs["<STR_LIT>"] = <NUM_LIT:1><EOL><DEDENT>self.packer = sh.Command(exec_path)<EOL>self.packer = self.packer.bake(**kwargs)<EOL>
: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 var_file: Path to variables file
:param string exec_path: Path to Packer executable