Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@noc:/opt/noc # hg diff
- diff -r 4afa39ee7cd6 sa/profiles/Cisco/IOS/get_inventory.py
- --- a/sa/profiles/Cisco/IOS/get_inventory.py Wed Nov 13 12:42:41 2013 +0400
- +++ b/sa/profiles/Cisco/IOS/get_inventory.py Wed Nov 13 14:51:25 2013 +0400
- @@ -20,7 +20,7 @@
- rx_item = re.compile(
- r"^NAME: \"(?P<name>[^\"]+)\", DESCR: \"(?P<descr>[^\"]+)\"\n"
- - r"PID: (?P<pid>\S+)\s*, VID: (?P<vid>\S+)\s*, SN: (?P<serial>\S+)",
- + r"PID: (?P<pid>\S+)\s*, VID:(?P<vid>......), SN: (?P<serial>\S+)",
- re.MULTILINE | re.DOTALL
- )
- rx_trans = re.compile("(1000Base..)")
- @@ -39,6 +39,15 @@
- match.group("name"), match.group("pid"),
- match.group("descr")
- )
- + vid = match.group("vid").strip()
- + if len(vid) == 0:
- + vid = None
- + self.debug("VID: %r" % vid)
- + self.debug("PID: %r" % part_no)
- + if len(objects) == 0:
- + type = "CHASSIS"
- + number = None
- + part_no = match.group("pid")
- if not part_no:
- print "!!! UNKNOWN: ", match.groupdict()
- continue
- @@ -51,7 +60,7 @@
- "serial": match.group("serial"),
- "description": match.group("descr"),
- "part_no": [part_no],
- - "revision": match.group("vid"),
- + "revision": vid,
- "builtin": False
- }]
- return objects
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement