Advertisement
Guest User

Untitled

a guest
Nov 13th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. root@noc:/opt/noc # hg diff
  2. diff -r 4afa39ee7cd6 sa/profiles/Cisco/IOS/get_inventory.py
  3. --- a/sa/profiles/Cisco/IOS/get_inventory.py Wed Nov 13 12:42:41 2013 +0400
  4. +++ b/sa/profiles/Cisco/IOS/get_inventory.py Wed Nov 13 14:51:25 2013 +0400
  5. @@ -20,7 +20,7 @@
  6.  
  7. rx_item = re.compile(
  8. r"^NAME: \"(?P<name>[^\"]+)\", DESCR: \"(?P<descr>[^\"]+)\"\n"
  9. - r"PID: (?P<pid>\S+)\s*, VID: (?P<vid>\S+)\s*, SN: (?P<serial>\S+)",
  10. + r"PID: (?P<pid>\S+)\s*, VID:(?P<vid>......), SN: (?P<serial>\S+)",
  11. re.MULTILINE | re.DOTALL
  12. )
  13. rx_trans = re.compile("(1000Base..)")
  14. @@ -39,6 +39,15 @@
  15. match.group("name"), match.group("pid"),
  16. match.group("descr")
  17. )
  18. + vid = match.group("vid").strip()
  19. + if len(vid) == 0:
  20. + vid = None
  21. + self.debug("VID: %r" % vid)
  22. + self.debug("PID: %r" % part_no)
  23. + if len(objects) == 0:
  24. + type = "CHASSIS"
  25. + number = None
  26. + part_no = match.group("pid")
  27. if not part_no:
  28. print "!!! UNKNOWN: ", match.groupdict()
  29. continue
  30. @@ -51,7 +60,7 @@
  31. "serial": match.group("serial"),
  32. "description": match.group("descr"),
  33. "part_no": [part_no],
  34. - "revision": match.group("vid"),
  35. + "revision": vid,
  36. "builtin": False
  37. }]
  38. return objects
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement