- Introduced a new `Huawei` model - Created a corresponding TTP template for Huawei devices. - Updated the base template to correct HTML entity encoding for vendor placeholders.
19 lines
455 B
Python
19 lines
455 B
Python
from oxi.interfaces import register_parser
|
|
from oxi.interfaces.base import BaseDevice
|
|
|
|
|
|
@register_parser(["vrp", "huawei"])
|
|
class Huawei(BaseDevice):
|
|
template = "huawei.ttp"
|
|
|
|
def vlans(self):
|
|
vlan_ids = self.raw["vlans"].get("vlan_ids")
|
|
return [{"vlan_id": vlan} for vlan in vlan_ids]
|
|
|
|
|
|
if __name__ == "__main__":
|
|
with open("./test4.txt") as file:
|
|
data = file.read()
|
|
huawei = Huawei(data)
|
|
print(huawei.parse())
|