diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index 03c8abcdf..f23fbc41d 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -2083,9 +2083,9 @@ def get_users(self): lowest access and 15 represents full access to the device. """ username_regex = r"^username\s+(?P\S+)\s+(?:privilege\s+(?P\S+)" \ - "\s+)?(?:secret \d+\s+(?P\S+))?$" + r"\s+)?(?:secret \d+\s+(?P\S+))?$" pub_keychain_regex = r"^\s+username\s+(?P\S+)(?P(?:\n\s+key-hash\s+" \ - "(?P\S+)\s+(?P\S+)(?:\s+\S+)?)+)$" + r"(?P\S+)\s+(?P\S+)(?:\s+\S+)?)+)$" users = {} command = "show run | section username" output = self._send_command(command) diff --git a/napalm/iosxr/iosxr.py b/napalm/iosxr/iosxr.py index 9c79c9ed6..1f3c4d71d 100644 --- a/napalm/iosxr/iosxr.py +++ b/napalm/iosxr/iosxr.py @@ -1315,23 +1315,32 @@ def get_route_to(self, destination='', protocol=''): raise TypeError('Wrong destination IP Address!') if ipv == 6: - route_info_rpc_command = '\ - defaultIPv6\ - Unicast\ - default
\ - {network}
{prefix}
\ -
\ -
'.format(network=network, prefix=prefix_tag) + route_info_rpc_command = ( + '' + 'defaultIPv6' + '' + 'Unicast' + '' + 'default' + '
' + '{network}
{prefix}
' + '
' + '
' + ).format(network=network, prefix=prefix_tag) else: - route_info_rpc_command = 'default\ - IPv4\ - Unicast\ - default
\ - {network}
{prefix}
\ -
'.format( - network=network, - prefix=prefix_tag - ) + route_info_rpc_command = ( + '' + 'default' + 'IPv4' + '' + 'Unicast' + '' + 'default' + '
' + '{network}
{prefix}
' + '
' + '
' + ).format(network=network, prefix=prefix_tag) routes_tree = ETREE.fromstring(self.device.make_rpc_call(route_info_rpc_command)) diff --git a/setup.py b/setup.py index 64606947e..f1c7a2c32 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="napalm", - version='2.3.0', + version='2.3.1', packages=find_packages(exclude=("test*", )), test_suite='test_base', author="David Barroso, Kirk Byers, Mircea Ulinic", diff --git a/test/base/validate/test_unit.py b/test/base/validate/test_unit.py index 058270a18..e0d9ad39f 100644 --- a/test/base/validate/test_unit.py +++ b/test/base/validate/test_unit.py @@ -5,9 +5,9 @@ _compare_getter = [ ( - {"list": ["\d{2}", 1, 2]}, + {"list": [r"\d{2}", 1, 2]}, [1, 2, 33], - {u'complies': True, u'extra': [], u'missing': [], u'present': ['\d{2}', 1, 2]} + {u'complies': True, u'extra': [], u'missing': [], u'present': [r'\d{2}', 1, 2]} ), ( {"list": [1, 2, 3]}, @@ -29,9 +29,9 @@ u'present': [1, 2, {'list': [1, 2]}]} ), ( - {"list": ['\d{2}', 4, 3]}, + {"list": [r'\d{2}', 4, 3]}, [1, 2, 3], - {u'complies': False, u'extra': [], u'missing': ['\d{2}', 4], u'present': [3]} + {u'complies': False, u'extra': [], u'missing': [r'\d{2}', 4], u'present': [3]} ), ( {"list": [{"list": [1, 2]}, 3]}, diff --git a/test/iosxr/mocked_data/test_get_route_to/SR638170159/_Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default______________VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTa.txt b/test/iosxr/mocked_data/test_get_route_to/SR638170159/_Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default__VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTable__SAF__Na.txt similarity index 100% rename from test/iosxr/mocked_data/test_get_route_to/SR638170159/_Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default______________VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTa.txt rename to test/iosxr/mocked_data/test_get_route_to/SR638170159/_Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default__VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTable__SAF__Na.txt