|
|
|
@ -70,6 +70,7 @@ AZURE_COMMON_REQUIRED_IF = [
|
|
|
|
|
|
|
|
|
|
ANSIBLE_USER_AGENT = 'Ansible/{0}'.format(ANSIBLE_VERSION)
|
|
|
|
|
CLOUDSHELL_USER_AGENT_KEY = 'AZURE_HTTP_USER_AGENT'
|
|
|
|
|
VSCODEEXT_USER_AGENT_KEY = 'VSCODEEXT_USER_AGENT'
|
|
|
|
|
|
|
|
|
|
CIDR_PATTERN = re.compile(r"(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1"
|
|
|
|
|
r"[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))")
|
|
|
|
@ -729,6 +730,9 @@ class AzureRMModuleBase(object):
|
|
|
|
|
# Add user agent when running from Cloud Shell
|
|
|
|
|
if CLOUDSHELL_USER_AGENT_KEY in os.environ:
|
|
|
|
|
client.config.add_user_agent(os.environ[CLOUDSHELL_USER_AGENT_KEY])
|
|
|
|
|
# Add user agent when running from VSCode extension
|
|
|
|
|
if VSCODEEXT_USER_AGENT_KEY in os.environ:
|
|
|
|
|
client.config.add_user_agent(os.environ[VSCODEEXT_USER_AGENT_KEY])
|
|
|
|
|
|
|
|
|
|
return client
|
|
|
|
|
|
|
|
|
|