From 48280463f2c8e60a222ac793fafb118ad9ce3c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20REY?= Date: Fri, 3 Aug 2018 19:14:14 +0200 Subject: [PATCH] modules/terraform: fix -no-color position in workspace command (#43644) --- lib/ansible/modules/cloud/misc/terraform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/misc/terraform.py b/lib/ansible/modules/cloud/misc/terraform.py index 26df3d76622..5c09349b27d 100644 --- a/lib/ansible/modules/cloud/misc/terraform.py +++ b/lib/ansible/modules/cloud/misc/terraform.py @@ -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))