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

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

* add changelog
This commit is contained in:
Alexis Camilleri 2020-02-21 17:14:22 +01:00 committed by GitHub
parent 600d6278f9
commit f70dc261cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -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)'

View file

@ -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')