backporting instance template change (#260)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-05-22 16:03:45 -07:00 committed by Alex Stephen
parent 3e51483452
commit 3f29f076ae

View file

@ -1086,14 +1086,19 @@ def raise_if_errors(response, err_path, module):
def encode_request(request, module):
if 'metadata' in request and request['metadata'] is not None:
request['metadata'] = metadata_encoder(request['metadata'])
if 'properties' in request and request['properties'] is not None and 'metadata' in request['properties'] and request['properties']['metadata'] is not None:
request['properties']['metadata'] = metadata_encoder(request['properties']['metadata'])
return request
def decode_response(response, module):
if 'metadata' in response and response['metadata'] is not None:
response['metadata'] = metadata_decoder(response['metadata'])
if (
'properties' in response
and response['properties'] is not None
and 'metadata' in response['properties']
and response['properties']['metadata'] is not None
):
response['properties']['metadata'] = metadata_decoder(response['properties']['metadata'])
return response