fixed all the PR comments

merge-requests/1/head
Md. Fasihul Kabir 3 years ago
parent 93cb7877aa
commit ebfcce2a21

@ -460,8 +460,20 @@ class Terraform:
"""List of workspaces
:return: workspaces
:example:
>>> tf = Terraform()
>>> tf.list_workspace()
['default', 'test']
"""
return list(filter(lambda x: len(x) > 0, map(lambda x: x.strip('*').strip(), self.cmd("workspace", "list")[1].split())))
return list(
filter(
lambda x: len(x) > 0,
map(
lambda x: x.strip('*').strip(),
(self.cmd("workspace", "list")[1] or '').split()
)
)
)
def __exit__(self, exc_type, exc_value, traceback) -> None:
self.temp_var_files.clean_up()

@ -452,4 +452,4 @@ class TestTerraform:
tf = Terraform(working_dir=current_path)
workspaces = tf.list_workspace()
assert len(workspaces) > 0
assert 'default' in workspaces
assert 'default' in workspaces

Loading…
Cancel
Save