Skip to content

Commit

Permalink
Escape parans in IOS version regex
Browse files Browse the repository at this point in the history
  • Loading branch information
bewing committed Nov 9, 2017
1 parent 52a2b0d commit 9cb0970
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,10 +884,10 @@ def get_facts(self):
except ValueError:
# Handle 'Cisco IOS Software [Denali],'
_, os_version = re.split(r"Cisco IOS Software \[.*?\], ", line)
os_version = os_version.strip()
elif re.search(r"IOS (tm).+Software", line):
elif re.search(r"IOS \(tm\).+Software", line):
_, os_version = line.split("IOS (tm) ")
os_version = os_version.strip()

os_version = os_version.strip()

# Determine domain_name and fqdn
for line in show_hosts.splitlines():
Expand Down

0 comments on commit 9cb0970

Please sign in to comment.