1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Remove object name validation.

This commit is contained in:
Chris Houseknecht 2016-07-06 17:29:42 -04:00 committed by Matt Clay
parent b55fd5f67a
commit a8059c68d0
7 changed files with 0 additions and 44 deletions

View file

@ -234,8 +234,6 @@ except ImportError:
pass
NAME_PATTERN = re.compile(r"^[a-z][a-z0-9-]{1,61}[a-z0-9]$")
def nic_to_dict(nic):
result = dict(
@ -349,10 +347,6 @@ class AzureRMNetworkInterface(AzureRMModuleBase):
# Set default location
self.location = resource_group.location
if not NAME_PATTERN.match(self.name):
self.fail("Parameter error: name must begin with a letter or number, end with a letter or number "
"and contain at least one number.")
if self.state == 'present':
if self.virtual_network_name and not self.subnet_name:
self.fail("Parameter error: a subnet is required when passing a virtual_network_name.")

View file

@ -125,8 +125,6 @@ except ImportError:
# This is handled in azure_rm_common
pass
NAME_PATTERN = re.compile(r"^[a-z][a-z0-9-]{1,61}[a-z0-9]$")
def pip_to_dict(pip):
result = dict(
@ -191,10 +189,6 @@ class AzureRMPublicIPAddress(AzureRMModuleBase):
# Set default location
self.location = resource_group.location
if not NAME_PATTERN.match(self.name):
self.fail("Parameter error: name must begin with a letter or number, end with a letter or number "
"and contain at least one number.")
try:
self.log("Fetch public ip {0}".format(self.name))
pip = self.network_client.public_ip_addresses.get(self.resource_group, self.name)

View file

@ -338,8 +338,6 @@ except ImportError:
# This is handled in azure_rm_common
pass
NAME_PATTERN = re.compile(r"^[a-zA-Z0-9._-]+$")
def validate_rule(rule, rule_type=None):
'''
@ -352,8 +350,6 @@ def validate_rule(rule, rule_type=None):
if not rule.get('name'):
raise Exception("Rule name value is required.")
if not NAME_PATTERN.match(rule.get('name')):
raise Exception("Rule name must contain only word characters plus '.','-','_'")
priority = rule.get('priority', None)
if not priority:
@ -551,9 +547,6 @@ class AzureRMSecurityGroup(AzureRMModuleBase):
# Set default location
self.location = resource_group.location
if not NAME_PATTERN.match(self.name):
self.fail("Parameter error: name must contain only word characters and '.','-','_'")
if self.rules:
for rule in self.rules:
try:

View file

@ -160,8 +160,6 @@ except ImportError:
pass
NAME_PATTERN = re.compile(r"^[a-z0-9]+$")
class AzureRMStorageAccount(AzureRMModuleBase):
@ -211,9 +209,6 @@ class AzureRMStorageAccount(AzureRMModuleBase):
# Set default location
self.location = resource_group.location
if not NAME_PATTERN.match(self.name):
self.fail("Parameter error: name must contain numbers and lowercase letters only.")
if len(self.name) < 3 or len(self.name) > 24:
self.fail("Parameter error: name length must be between 3 and 24 characters.")

View file

@ -210,9 +210,6 @@ except ImportError:
pass
NAME_PATTERN = re.compile(r"^(?!-)(?!.*--)[a-z0-9\-]+$")
class AzureRMStorageBlob(AzureRMModuleBase):
def __init__(self):
@ -270,11 +267,6 @@ class AzureRMStorageBlob(AzureRMModuleBase):
self.results['check_mode'] = self.check_mode
if not NAME_PATTERN.match(self.container):
self.fail("Parameter error: container_name must consist of lowercase letters, "
"numbers and hyphens. It must begin with a letter or number. It may "
"not contain two consecutive hyphens.")
# add file path validation
self.blob_client = self.get_blob_client(self.resource_group, self.storage_account_name)

View file

@ -139,8 +139,6 @@ except ImportError:
pass
NAME_PATTERN = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9.-_]+[a-zA-Z0-9_]$")
def subnet_to_dict(subnet):
result = dict(
@ -198,10 +196,6 @@ class AzureRMSubnet(AzureRMModuleBase):
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
if not NAME_PATTERN.match(self.name):
self.fail("Parameter error: name must begin with a letter or number, end with a letter, number "
"or underscore and may contain only letters, numbers, periods, underscores or hyphens.")
if self.state == 'present' and not CIDR_PATTERN.match(self.address_prefix_cidr):
self.fail("Invalid address_prefix_cidr value {0}".format(self.address_prefix_cidr))

View file

@ -145,8 +145,6 @@ except ImportError:
pass
NAME_PATTERN = re.compile(r"^[a-zA-Z0-9]+[a-zA-Z0-9\._-]+[a-zA-Z0-9_]+$")
def virtual_network_to_dict(vnet):
'''
@ -228,10 +226,6 @@ class AzureRMVirtualNetwork(AzureRMModuleBase):
# Set default location
self.location = resource_group.location
if not NAME_PATTERN.match(self.name):
self.fail("Parameter error: name must begin with a letter or number, end with a letter, number "
"or underscore and may contain only letters, numbers, periods, underscores or hyphens.")
if self.state == 'present' and self.purge_address_prefixes:
for prefix in self.address_prefixes_cidr:
if not CIDR_PATTERN.match(prefix):