fix(scaleway): use jsonify for application/json content-type only (#66957)

* fix(scaleway): use jsonify for application/json content-type

* add changelog
pull/67655/head
Alexis Camilleri 4 years ago committed by GitHub
parent 600d6278f9
commit f70dc261cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- 'scaleway: use jsonify unmarshaller only for application/json requests to avoid breaking the multiline configuration with requests in text/plain (https://github.com/ansible/ansible/issues/65036)'

@ -118,11 +118,13 @@ class Scaleway(object):
def send(self, method, path, data=None, headers=None, params=None):
url = self._url_builder(path=path, params=params)
self.warn(url)
data = self.module.jsonify(data)
if headers is not None:
self.headers.update(headers)
if self.headers['Content-Type'] == "application/json":
data = self.module.jsonify(data)
resp, info = fetch_url(
self.module, url, data=data, headers=self.headers, method=method,
timeout=self.module.params.get('api_timeout')

Loading…
Cancel
Save