Skip to content

Commit ef976df

Browse files
committed
fix workspace select option placement
1 parent 055d19b commit ef976df

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/infrablocks/invoke_terraform/terraform/terraform.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ def select_workspace(
5050
or_create: bool = False,
5151
):
5252
base_command = self._build_base_command(chdir)
53-
command = base_command + ["workspace", "select", workspace]
53+
command = base_command + ["workspace", "select"]
5454

5555
if or_create:
5656
command = command + ["-or-create=true"]
5757

58+
command = command + [workspace]
59+
5860
self._executor.execute(command)
5961

6062
@staticmethod

tests/unit/infrablocks/invoke_terraform/terraform/test_terraform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,5 @@ def test_select_workspace_executes_with_or_create(self):
143143
terraform.select_workspace(workspace, or_create=True)
144144

145145
executor.execute.assert_called_once_with(
146-
["terraform", "workspace", "select", workspace, "-or-create=true"]
146+
["terraform", "workspace", "select", "-or-create=true", workspace]
147147
)

0 commit comments

Comments
 (0)