From 3d1473c64144608a98ba7a3fb2a465cca3fc5dc4 Mon Sep 17 00:00:00 2001 From: slater-as Date: Wed, 4 Jun 2025 09:46:44 +0100 Subject: [PATCH] Update ios.py Fixing an issue where there are no VRFs on the device, an exception is raised --- napalm/ios/ios.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index ad35c5a72..92adf1d7c 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -3612,7 +3612,10 @@ def get_network_instances(self, name=""): first_part = vrf.split("Address family")[0] # retrieve the name of the VRF and the Route Distinguisher - vrf_name, RD = re.match(r"^VRF (\S+).*RD (.*);", first_part).groups() + match = re.match(r"^VRF (\S+).*RD (.*);", first_part) + if not match: + return instances + vrf_name, RD = match.groups() if RD == "": RD = ""