From 7bf24eeb84bcd66b4bcdee832204cb4e2500be7f Mon Sep 17 00:00:00 2001 From: Kosala Atapattu Date: Mon, 25 Sep 2023 08:20:10 +1300 Subject: [PATCH] Fixing incorrect string encapsulation for -backend-config. (#7301) * Fixing incorrect string encapsulation for -backend-config. Removing shlex_quote. * Adding change log fragemnt for bugfix: - "terraform module - prevents `-backend-config` option double encapsulating with `shlex_quote` function. (https://github.com/ansible-collections/community.general/pull/7301)." * Update changelogs/fragments/7301-fix-backend-config-string-encapsulation.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- .../fragments/7301-fix-backend-config-string-encapsulation.yml | 2 ++ plugins/modules/terraform.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/7301-fix-backend-config-string-encapsulation.yml diff --git a/changelogs/fragments/7301-fix-backend-config-string-encapsulation.yml b/changelogs/fragments/7301-fix-backend-config-string-encapsulation.yml new file mode 100644 index 0000000000..f8d01450f4 --- /dev/null +++ b/changelogs/fragments/7301-fix-backend-config-string-encapsulation.yml @@ -0,0 +1,2 @@ +bugfixes: + - "terraform - prevents ``-backend-config`` option double encapsulating with ``shlex_quote`` function. (https://github.com/ansible-collections/community.general/pull/7301)." \ No newline at end of file diff --git a/plugins/modules/terraform.py b/plugins/modules/terraform.py index 925961a032..27870b5b7c 100644 --- a/plugins/modules/terraform.py +++ b/plugins/modules/terraform.py @@ -325,7 +325,7 @@ def init_plugins(bin_path, project_path, backend_config, backend_config_files, i for key, val in backend_config.items(): command.extend([ '-backend-config', - shlex_quote('{0}={1}'.format(key, val)) + '{0}={1}'.format(key, val) ]) if backend_config_files: for f in backend_config_files: