add oxiApi
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
from abc import ABC
|
||||
from dataclasses import dataclass
|
||||
from typing import Protocol
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -25,7 +25,7 @@ class ParsedDeviceData:
|
||||
vlans: list[Vlan]
|
||||
|
||||
|
||||
class BaseDevice(ABC):
|
||||
class BaseDevice(Protocol):
|
||||
anchor_pattern: str = '!'
|
||||
hostname_pattern: str = 'hostname'
|
||||
|
||||
@@ -81,7 +81,7 @@ class BaseDevice(ABC):
|
||||
ip_address_match = re.search(r'\s?ip address\s(.+)$', interface_block, re.MULTILINE)
|
||||
if not description_match and not ip_address_match:
|
||||
continue
|
||||
ip_address = ip_address_match.group(1) if ip_address_match else None
|
||||
ip_address = ip_address_match.group(1).replace(' ', '/') if ip_address_match else None
|
||||
description = description_match.group(1) if description_match else None
|
||||
interfaces.append(L3Interface(
|
||||
interface=interface_name,
|
||||
|
||||
Reference in New Issue
Block a user