Advertisement
Guest User

Untitled

a guest
Jun 15th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. diff -r 3fdf7ba71c24 sa/profiles/Cisco/IOS/get_inventory.py
  2. --- a/sa/profiles/Cisco/IOS/get_inventory.py Sun Jun 15 11:03:51 2014 +0400
  3. +++ b/sa/profiles/Cisco/IOS/get_inventory.py Sun Jun 15 11:48:13 2014 +0400
  4. @@ -77,6 +77,8 @@
  5. # Last chance to get idprom
  6. if match.group("name").startswith("Transceiver"):
  7. int = match.group("name").split()[1]
  8. + elif match.group("name").startswith("GigabitEthernet"):
  9. + int = match.group("name").split()[0]
  10. else:
  11. int = match.group("name")
  12. vendor, t_sn, t_rev, part_no = self.get_idprom(
  13. @@ -197,6 +199,7 @@
  14. return None, None, None, None
  15. except self.CLISyntaxError:
  16. print "sh idprom command not supported"
  17. + return None, None, None, None
  18.  
  19.  
  20. def get_type(self, name, pid, descr, lo):
  21. @@ -301,7 +304,11 @@
  22. return "PSU", name.split()[2], pid
  23. elif pid.startswith("FAN"):
  24. # Fan module
  25. - return "FAN", name.split()[1], pid
  26. + try:
  27. + number = int(name[-1:])
  28. + except:
  29. + number = name.split()[1]
  30. + return "FAN", number, pid
  31. elif (pid.startswith("NM-") or pid.startswith("NME-")
  32. or pid.startswith("EVM-") or pid.startswith("EM-")):
  33. # Network Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement