dev #3

Merged
gitark merged 84 commits from dev into main 2026-06-12 16:00:25 +03:00
2 changed files with 2 additions and 13 deletions
Showing only changes of commit bf6dd0c189 - Show all commits

View File

@@ -8,17 +8,6 @@ from oxi.interfaces.base import BaseDevice
class Qtech(BaseDevice):
template = "qtech.ttp"
def interfaces(self) -> list[dict]:
interfaces_ttp = self.raw["interfaces"]
for item in interfaces_ttp:
if item.get("ip_address") and item.get("netmask"):
ipaddress = ip_interface(
f"{item.get('ip_address')}/{item.get('netmask')}"
)
item["mask"] = ipaddress.network.prefixlen
item.pop("netmask", "Key not found")
return interfaces_ttp
def vlans(self) -> list[dict]:
vlans_ttp = self.raw["vlans"]
vlans = []
@@ -46,4 +35,4 @@ if __name__ == "__main__":
data = file.read()
qtech = Qtech(data)
qt = qtech.parse()
# print(qt)
print(qt)

View File

@@ -16,7 +16,7 @@ default_system = {
<group name="interfaces">
interface {{ interface }}
description {{ description | ORPHRASE }}
ip address {{ ip_address }} {{ netmask }}
ip address {{ ip_address }} {{ mask | to_cidr }}
</group>
<group name="vlans">