mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-06-06 00:49:10 -07:00
fix gcp_iam_role not updating
gcp_iam_role was not updating previously. The API uses a PATCH and not a PUT. Also fixing an accidental leftover diff from a bad merge. fixes #236.
This commit is contained in:
parent
d063d44b73
commit
2db181d084
6 changed files with 41 additions and 18 deletions
|
@ -107,12 +107,12 @@ class GcpSession(object):
|
|||
kwargs = {'json': body}
|
||||
return self.full_delete(url, **kwargs)
|
||||
|
||||
def put(self, url, body=None):
|
||||
def put(self, url, body=None, params=None):
|
||||
"""
|
||||
This method should be avoided in favor of full_put
|
||||
"""
|
||||
kwargs = {'json': body}
|
||||
return self.full_put(url, **kwargs)
|
||||
return self.full_put(url, **kwargs, params=params)
|
||||
|
||||
def patch(self, url, body=None, **kwargs):
|
||||
"""
|
||||
|
@ -305,7 +305,14 @@ class GcpModule(AnsibleModule):
|
|||
try:
|
||||
response.raise_for_status()
|
||||
except getattr(requests.exceptions, 'RequestException') as inst:
|
||||
self.fail_json(msg="GCP returned error: %s" % response.json())
|
||||
self.fail_json(
|
||||
msg="GCP returned error: %s" % response.json(),
|
||||
request={
|
||||
"url": response.request.url,
|
||||
"body": response.request.body,
|
||||
"method": response.request.method,
|
||||
}
|
||||
)
|
||||
|
||||
def _merge_dictionaries(self, a, b):
|
||||
new = a.copy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue