Refactor Mikrotik model and update TTP template for improved configuration handling
- Removed unused imports and main execution block from the Mikrotik model for cleaner code. - Updated the Mikrotik TTP template to adjust the order of parameters in the 'add' command, enhancing clarity in the generated configurations. - Added a new configuration file `config.conf` for Mikrotik devices to facilitate testing and validation of parsing functionality.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import os
|
||||
from oxi.interfaces import register_parser
|
||||
from oxi.interfaces.base import BaseDevice
|
||||
|
||||
@@ -6,11 +5,3 @@ from oxi.interfaces.base import BaseDevice
|
||||
@register_parser(["routeros", "ros", "mikrotik"])
|
||||
class Mikrotik(BaseDevice):
|
||||
template = "mikrotik.ttp"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(os.path.abspath(os.curdir))
|
||||
with open("./test.txt") as file:
|
||||
data = file.read()
|
||||
mikr = Mikrotik(data)
|
||||
print(mikr.parse().json())
|
||||
|
||||
Reference in New Issue
Block a user