one more test green

This commit is contained in:
jem 2021-11-09 09:18:49 +01:00
parent f913b1d6b7
commit 085273a726

View file

@ -366,7 +366,8 @@ class Terraform:
if capture_output is False: if capture_output is False:
raise ValueError("capture_output is required for this method") raise ValueError("capture_output is required for this method")
ret, out, _ = self.output_cmd(*args, **kwargs) global_opts = self._generate_default_general_options(False)
ret, out, _ = self.output_cmd(global_opts, *args, **kwargs)
if ret: if ret:
return None return None
@ -402,7 +403,8 @@ class Terraform:
:param workspace: the desired workspace. :param workspace: the desired workspace.
:return: status :return: status
""" """
return self.cmd("workspace", "select", workspace, *args, **kwargs) global_opts = self._generate_default_general_options(False)
return self.cmd(global_opts, "workspace", "select", workspace, *args, **kwargs)
def create_workspace(self, workspace, *args, **kwargs) -> CommandOutput: def create_workspace(self, workspace, *args, **kwargs) -> CommandOutput:
"""Create workspace """Create workspace
@ -410,7 +412,8 @@ class Terraform:
:param workspace: the desired workspace. :param workspace: the desired workspace.
:return: status :return: status
""" """
return self.cmd("workspace", "new", workspace, *args, **kwargs) global_opts = self._generate_default_general_options(False)
return self.cmd(global_opts, "workspace", "new", workspace, *args, **kwargs)
def delete_workspace(self, workspace, *args, **kwargs) -> CommandOutput: def delete_workspace(self, workspace, *args, **kwargs) -> CommandOutput:
"""Delete workspace """Delete workspace
@ -418,14 +421,16 @@ class Terraform:
:param workspace: the desired workspace. :param workspace: the desired workspace.
:return: status :return: status
""" """
return self.cmd("workspace", "delete", workspace, *args, **kwargs) global_opts = self._generate_default_general_options(False)
return self.cmd(global_opts, "workspace", "delete", workspace, *args, **kwargs)
def show_workspace(self, **kwargs) -> CommandOutput: def show_workspace(self, **kwargs) -> CommandOutput:
"""Show workspace, this command does not need the [DIR] part """Show workspace, this command does not need the [DIR] part
:return: workspace :return: workspace
""" """
return self.cmd("workspace", "show", **kwargs) global_opts = self._generate_default_general_options(False)
return self.cmd(global_opts, "workspace", "show", **kwargs)
def _generate_default_args(self, dir_or_plan: Optional[str]) -> Sequence[str]: def _generate_default_args(self, dir_or_plan: Optional[str]) -> Sequence[str]:
if (self.terraform_version < 1.0 and dir_or_plan): if (self.terraform_version < 1.0 and dir_or_plan):
@ -507,7 +512,8 @@ class Terraform:
if cmd_name.endswith("_cmd"): if cmd_name.endswith("_cmd"):
cmd_name = cmd_name[:-4] cmd_name = cmd_name[:-4]
logger.debug("called with %r and %r", args, kwargs) logger.debug("called with %r and %r", args, kwargs)
return self.cmd(cmd_name, *args, **kwargs) global_opts = self._generate_default_general_options(False)
return self.cmd(global_opts, cmd_name, *args, **kwargs)
return wrapper return wrapper