Skip to content

Commit

Permalink
Fixing incorrect string encapsulation for -backend-config. (#7301)
Browse files Browse the repository at this point in the history
* 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. (#7301)."

* Update changelogs/fragments/7301-fix-backend-config-string-encapsulation.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 7bf24ee)
  • Loading branch information
kosalaat authored and patchback[bot] committed Sep 24, 2023
1 parent d5efc3f commit ba835fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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)."
2 changes: 1 addition & 1 deletion plugins/modules/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ba835fa

Please sign in to comment.