diff --git a/lib/ansible/module_utils/gcp_utils.py b/lib/ansible/module_utils/gcp_utils.py index 46bb2b88637..65cd877781d 100644 --- a/lib/ansible/module_utils/gcp_utils.py +++ b/lib/ansible/module_utils/gcp_utils.py @@ -69,7 +69,7 @@ def replace_resource_dict(item, value): new_item = ast.literal_eval(item) return replace_resource_dict(new_item, value) except ValueError: - return new_item + return item # Handles all authentication and HTTP sessions for GCP API calls. diff --git a/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py b/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py index 50b5f211887..d87bd82de3b 100644 --- a/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py +++ b/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py @@ -376,7 +376,7 @@ def prefetch_soa_resource(module): result = fetch_wrapped_resource(resource, 'dns#resourceRecordSet', 'dns#resourceRecordSetsListResponse', 'rrsets') if not result: - raise ValueError("Google DNS Managed Zone %s not found" % module.params['managed_zone']['name']) + raise ValueError("Google DNS Managed Zone %s not found" % replace_resource_dict(module.params['managed_zone'], 'name')) return result