Commit 1ff003aa authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Add Rotek vendor to Raisecom.ROS profile.

parent 24c560ee
Pipeline #15228 passed with stages
in 11 minutes and 25 seconds
......@@ -20,7 +20,7 @@ class Script(BaseScript):
def execute_cli(self):
v = self.profile.get_version(self)
return {
"vendor": "Raisecom",
"vendor": v.get("vendor", "Raisecom"),
"platform": v["platform"],
"version": v["version"],
"attributes": {
......
......@@ -130,35 +130,47 @@ class Profile(BaseProfile):
re.MULTILINE,
)
rx_ver_rotek = re.compile(r"Rotek Operating System Software\n" r"Copyright .+NPK Rotek")
# NPK Rotek some Chinese vendor
def get_version(self, script):
c = script.cli("show version", cached=True)
r = {"vendor": "Raisecom"}
if self.rx_ver_rotek.match(c):
r["vendor"] = "Rotek"
if "Support ipv6" in c:
match = self.rx_ver.search(c)
else:
match = self.rx_ver_wipv6.search(c)
if match:
return match.groupdict()
r.update(match.groupdict())
return r
else:
match = self.rx_ver2.search(c)
if match:
return match.groupdict()
r.update(match.groupdict())
return r
else:
match = self.rx_ver_2016.search(c)
if match:
return match.groupdict()
r.update(match.groupdict())
return r
else:
match = self.rx_ver_2015.search(c)
if match:
return match.groupdict()
r.update(match.groupdict())
return r
else:
match = self.rx_ver_2017.search(c)
if match:
return match.groupdict()
r.update(match.groupdict())
return r
else:
match = self.rx_ver3.search(c)
return match.groupdict()
r.update(match.groupdict())
return r
rx_port = re.compile("^port(|\s+)(?P<port>\d+)")
rx_port = re.compile(r"^port(|\s+)(?P<port>\d+)")
def convert_interface_name(self, interface):
if interface.startswith("GE"):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment