Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 219fbcf8f435 sa/profiles/Huawei/VRP/get_interfaces.py
- --- a/sa/profiles/Huawei/VRP/get_interfaces.py Fri Oct 05 10:46:20 2012 +0300
- +++ b/sa/profiles/Huawei/VRP/get_interfaces.py Fri Oct 05 15:19:02 2012 +0300
- @@ -45,6 +45,7 @@
- "Aux": "physical",
- "Eth-Trunk": "aggregated",
- "Ip-Trunk": "aggregated",
- + "Ethernet": "physical",
- "GigabitEthernet": "physical",
- "Logic-Channel": "tunnel",
- "LoopBack": "loopback",
- diff -r 219fbcf8f435 sa/profiles/Huawei/VRP/get_version.py
- --- a/sa/profiles/Huawei/VRP/get_version.py Fri Oct 05 10:46:20 2012 +0300
- +++ b/sa/profiles/Huawei/VRP/get_version.py Fri Oct 05 15:19:02 2012 +0300
- @@ -19,7 +19,8 @@
- rx_ver = re.compile(r"^VRP.+Software, Version (?P<version>[^ ,]+),? .*?\n\s*(?:Quidway|Huawei) (?P<platform>(?:NetEngine\s+)?\S+)[^\n]+uptime", re.MULTILINE | re.DOTALL | re.IGNORECASE)
- rx_ver_snmp = re.compile(r"Versatile Routing Platform Software.*?Version (?P<version>[^ ,]+),? .*?\n\s*(?:Quidway|Huawei) (?P<platform>(?:NetEngine\s+)?[^ \t\n\r\f\v\-]+)[^\n]+", re.MULTILINE | re.DOTALL | re.IGNORECASE)
- rx_ver_snmp2 = re.compile(r"(?P<platform>(?:\S+\s+)?S\d+(?:[A-Z]+-[A-Z]+)?(?:\d+\S+)?)\s+Huawei\sVersatile\sRouting\sPlatform\sSoftware.*Version\s(?P<version>\d+\.\d+)\s\(S\d+\s(?P<image>\S+)+\).*", re.MULTILINE | re.DOTALL | re.IGNORECASE)
- - rx_ver_snmp3 = re.compile(r"^\s*VRP.+Software, Version (?P<version>\S+) \((?P<platform>S\S+) (?P<image>\S+)", re.MULTILINE | re.DOTALL | re.IGNORECASE)
- + rx_ver_snmp3 = re.compile(r"^\s*VRP.+Software, Version (?P<version>\S+) \((?P<platform>S\S+) (?P<image>\S+)\)", re.MULTILINE | re.DOTALL | re.IGNORECASE)
- + rx_serial = re.compile(r"BarCode=(?P<serial>\w+).+Item=", re.MULTILINE | re.DOTALL | re.IGNORECASE)
- def execute(self):
- v = ""
- @@ -47,9 +48,18 @@
- r = {
- "vendor": "Huawei",
- "platform": platform,
- - "version": match.group("version")
- + "version": match.group("version"),
- + "attributes": {}
- }
- if "image" in match.groupdict():
- image = match.group("image")
- - r["attributes"] = {"image": image}
- + r["attributes"].update({"image": image})
- + try:
- + v = self.cli("display elabel")
- + except self.CLISyntaxError:
- + raise self.NotSupportedError()
- + match = self.rx_serial.search(v)
- + if match:
- + serial = match.group("serial")
- + r["attributes"].update({"serial": serial})
- return r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement