diff --git a/plugins/module_utils/common/conversion.py b/plugins/module_utils/common/conversion.py index e58d497e8..a8c94078c 100644 --- a/plugins/module_utils/common/conversion.py +++ b/plugins/module_utils/common/conversion.py @@ -32,29 +32,7 @@ class ConversionUtils: """ def __init__(self): - re_asn_string = "^((" - re_asn_string += "(\\+)?[1-9]{1}[0-9]{0,8}|" - re_asn_string += "(\\+)?[1-3]{1}[0-9]{1,9}|" - re_asn_string += "(\\+)?" - re_asn_string += "[4]{1}([0-1]{1}[0-9]{8}|" - re_asn_string += "[2]{1}([0-8]{1}[0-9]{7}|" - re_asn_string += "[9]{1}([0-3]{1}[0-9]{6}|" - re_asn_string += "[4]{1}([0-8]{1}[0-9]{5}|" - re_asn_string += "[9]{1}([0-5]{1}[0-9]{4}|" - re_asn_string += "[6]{1}([0-6]{1}[0-9]{3}|" - re_asn_string += "[7]{1}([0-1]{1}[0-9]{2}|" - re_asn_string += "[2]{1}([0-8]{1}[0-9]{1}|" - re_asn_string += "[9]{1}[0-5]{1})))))))))|" - re_asn_string += "([1-5]\\d{4}|" - re_asn_string += "[1-9]\\d{0,3}|" - re_asn_string += "6[0-4]\\d{3}|" - re_asn_string += "65[0-4]\\d{2}|" - re_asn_string += "655[0-2]\\d|" - re_asn_string += "6553[0-5])(\\.[1-5]\\d{4}|[1-9]\\d{0,3}|" - re_asn_string += "6[0-4]\\d{3}|65[0-4]\\d{2}|" - re_asn_string += "655[0-2]\\d|6553[0-5]|0)?)$" - self.re_asn = re.compile(re_asn_string) - + self.re_asn = re.compile("^(((\\+)?[1-9]{1}[0-9]{0,8}|(\\+)?[1-3]{1}[0-9]{1,9}|(\\+)?[4]{1}([0-1]{1}[0-9]{8}|[2]{1}([0-8]{1}[0-9]{7}|[9]{1}([0-3]{1}[0-9]{6}|[4]{1}([0-8]{1}[0-9]{5}|[9]{1}([0-5]{1}[0-9]{4}|[6]{1}([0-6]{1}[0-9]{3}|[7]{1}([0-1]{1}[0-9]{2}|[2]{1}([0-8]{1}[0-9]{1}|[9]{1}[0-5]{1})))))))))|([1-5]\\d{4}|[1-9]\\d{0,3}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])(\\.([1-5]\\d{4}|[1-9]\\d{0,3}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5]|0))?)$") self.bgp_as_invalid_reason = None def bgp_as_is_valid(self, value):