1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

modules/terraform: fix -no-color position in workspace command (#43644)

This commit is contained in:
Rémi REY 2018-08-03 19:14:14 +02:00 committed by Ryan Brown
parent d8bdf38b50
commit 48280463f2

View file

@ -183,7 +183,7 @@ def init_plugins(bin_path, project_path):
def get_workspace_context(bin_path, project_path):
workspace_ctx = {"current": "default", "all": []}
command = [bin_path, 'workspace', '-no-color', 'list']
command = [bin_path, 'workspace', 'list', '-no-color']
rc, out, err = module.run_command(command, cwd=project_path)
if rc != 0:
module.fail_json(msg="Failed to list Terraform workspaces:\r\n{0}".format(err))
@ -199,7 +199,7 @@ def get_workspace_context(bin_path, project_path):
def _workspace_cmd(bin_path, project_path, action, workspace):
command = [bin_path, 'workspace', '-no-color', action, workspace]
command = [bin_path, 'workspace', action, workspace, '-no-color']
rc, out, err = module.run_command(command, cwd=project_path)
if rc != 0:
module.fail_json(msg="Failed to {0} workspace:\r\n{1}".format(action, err))