Adding additional workspace items.

merge-requests/1/head
DJDavisson 5 years ago
parent 57a80d7e71
commit 749bec79e4

@ -399,10 +399,35 @@ class Terraform(object):
"""
options = kwargs
options['workspace'] = workspace
options = self._generate_default_options(options)
args = self._generate_default_args(dir_or_plan)
return self.cmd('workspace', *args, **options)
return self.cmd('workspace select ' + workspace, *args, **options)
def create_workspace(self, workspace=None, dir_or_plan=None, **kwargs):
"""
set workspace
:param workspace: the desired workspace.
:param dir: The dir we want to swap workspace in.
:return: nothing
"""
options = kwargs
options = self._generate_default_options(options)
args = self._generate_default_args(dir_or_plan)
return self.cmd('workspace new ' + workspace, *args, **options)
def show_workspace(self, workspace=None, dir_or_plan=None, **kwargs):
"""
set workspace
:param workspace: the desired workspace.
:param dir: The dir we want to swap workspace in.
:return: nothing
"""
options = kwargs
options = self._generate_default_options(options)
args = self._generate_default_args(dir_or_plan)
return self.cmd('workspace show', *args, **options)
def __exit__(self, exc_type, exc_value, traceback):
self.temp_var_files.clean_up()

Loading…
Cancel
Save