terraform workspace list failure warns instead of fails (#65044)

* terraform workspace list failure warns instead of fails

Fixes #64788

* add a changelog fragment
pull/66018/head
Christophe Drevet-Droguet 5 years ago committed by Felix Fontein
parent e711d01ed1
commit b580f2929d

@ -0,0 +1,2 @@
bugfixes:
- terraform module - fixes usage for providers not supporting workspaces

@ -209,7 +209,7 @@ def get_workspace_context(bin_path, project_path):
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))
module.warn("Failed to list Terraform workspaces:\r\n{0}".format(err))
for item in out.split('\n'):
stripped_item = item.strip()
if not stripped_item:

Loading…
Cancel
Save