Bug fixes for GCP modules (#52616)

This commit is contained in:
The Magician 2019-02-20 13:27:05 -08:00 committed by ansibot
parent a94d16adef
commit a6752f002b
4 changed files with 118 additions and 7 deletions

View file

@ -435,6 +435,7 @@ sourceType:
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest, remove_nones_from_dict, replace_resource_dict
import json
import re
import time
################################################################################
@ -628,6 +629,15 @@ def response_to_hash(module, response):
}
def license_selflink(name, params):
if name is None:
return
url = r"https://www.googleapis.com/compute/v1//projects/.*/global/licenses/[a-z1-9\-]*"
if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1//projects/{project}/global/licenses/%s".format(**params) % name
return name
def async_op_url(module, extra_data=None):
if extra_data is None:
extra_data = {}