Allow more ports to be seen on Catalyst switches
Show the Gi1/1/X and Te1/1/X ports to show up, even if they are not
currently working.
Change-Id: I16dfbccd38b68275d097ada79ab9df6fd715d73a
diff --git a/drivers/CiscoCatalyst.py b/drivers/CiscoCatalyst.py
index dbe5ff7..1760812 100644
--- a/drivers/CiscoCatalyst.py
+++ b/drivers/CiscoCatalyst.py
@@ -485,7 +485,8 @@
# match interfaces - it will match lines with "connected" or
# "notconnect".
regex = re.compile(r'^\s*([a-zA-Z0-9_/]*).*(connect)(.*)')
- regex1 = re.compile('.*Not Present.*')
+ # Deliberately drop things marked as "routed", i.e. the
+ # management port
regex2 = re.compile('.*routed.*')
try:
@@ -495,11 +496,8 @@
if match:
interface = match.group(1)
junk = match.group(3)
- match1 = regex1.match(junk) # Deliberately drop things
- # marked as "Not Present"
- match2 = regex2.match(junk) # Deliberately drop things
- # marked as "routed"
- if not match1 and not match2:
+ match2 = regex2.match(junk)
+ if not match2:
interfaces.append(interface)
logging.debug(" found %d ports on the switch", len(interfaces))
return interfaces