From 8f084ac065c005eb11792d1174ebe726d3dfc1cb Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 27 Dec 2021 19:55:43 +0100 Subject: [PATCH] fix scaleway_user_data (#3940) (#3953) * fix scaleway_user_data scaleway_user_data put cloud-init valuer with 2 unexpected " (begin and end of value) If Content-Type is not change , it's jsonify ( file module_utils/scaleway.py ligne 131 ) fix the probleme when "Content-Type" is used instead of "Content-type" * Create 3940_fix_contenttype_scaleway_user_data.yml * Update changelogs/fragments/3940_fix_contenttype_scaleway_user_data.yml Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit 043b407412711cd4fc0b97d396e4a2007611d29e) Co-authored-by: pmangin <96626847+pmangin@users.noreply.github.com> --- .../fragments/3940_fix_contenttype_scaleway_user_data.yml | 2 ++ plugins/modules/cloud/scaleway/scaleway_user_data.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3940_fix_contenttype_scaleway_user_data.yml diff --git a/changelogs/fragments/3940_fix_contenttype_scaleway_user_data.yml b/changelogs/fragments/3940_fix_contenttype_scaleway_user_data.yml new file mode 100644 index 0000000000..97d97b67c1 --- /dev/null +++ b/changelogs/fragments/3940_fix_contenttype_scaleway_user_data.yml @@ -0,0 +1,2 @@ +bugfixes: + - scaleway_user_data - fix double-quote added where no double-quote is needed to user data in scaleway's server (``Content-type`` -> ``Content-Type``) (https://github.com/ansible-collections/community.general/pull/3940). diff --git a/plugins/modules/cloud/scaleway/scaleway_user_data.py b/plugins/modules/cloud/scaleway/scaleway_user_data.py index 2a468a1734..2848ec2c4a 100644 --- a/plugins/modules/cloud/scaleway/scaleway_user_data.py +++ b/plugins/modules/cloud/scaleway/scaleway_user_data.py @@ -75,7 +75,7 @@ def patch_user_data(compute_api, server_id, key, value): compute_api.module.debug("Starting patching user_data attributes") path = "servers/%s/user_data/%s" % (server_id, key) - response = compute_api.patch(path=path, data=value, headers={"Content-type": "text/plain"}) + response = compute_api.patch(path=path, data=value, headers={"Content-Type": "text/plain"}) if not response.ok: msg = 'Error during user_data patching: %s %s' % (response.status_code, response.body) compute_api.module.fail_json(msg=msg)