Do not try to encode metadata if it is None (#46739)
* Do not try to encode metadata if it is None * Add changelog fragment * Fix fragment missing EOF line
This commit is contained in:
parent
fcef4fdb26
commit
62d131716b
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "gcp_compute_instance - fix crash when the instance metadata is not set"
|
|
@ -1106,7 +1106,7 @@ def raise_if_errors(response, err_path, module):
|
||||||
|
|
||||||
|
|
||||||
def encode_request(request, module):
|
def encode_request(request, module):
|
||||||
if 'metadata' in request:
|
if 'metadata' in request and request['metadata'] is not None:
|
||||||
request['metadata'] = metadata_encoder(request['metadata'])
|
request['metadata'] = metadata_encoder(request['metadata'])
|
||||||
return request
|
return request
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue