Refactor Mikrotik model and update template structure
- Changed the parsing method in `NodeConfig` to use `parse()` instead of `parse_config()`. - Updated the template loading path in `BaseDevice` to reflect the new directory structure. - Enhanced the `Mikrotik` class with new methods for `system`, `interfaces`, and `vlans`, including debug print statements. - Expanded the TTP template for Mikrotik to include structured variable definitions and groups for system, interfaces, and VLANs.
This commit is contained in:
@@ -68,8 +68,10 @@ class BaseDevice(ABC):
|
||||
...
|
||||
|
||||
def _load_template(self):
|
||||
path = Path(__file__).parent / "template" / self.template
|
||||
path = Path(__file__).parent / "models" / "templates" / self.template
|
||||
if not path.exists():
|
||||
print("-" * 12)
|
||||
print(path)
|
||||
raise FileNotFoundError(f"Template {self.template} not found")
|
||||
return path.read_text(encoding="utf-8")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user