Reversed CLEANUP
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python3.7
|
#!/usr/bin/python3
|
||||||
"""Programmatically configure Aviat INUes using their undocumented protocol."""
|
"""Programmatically configure Aviat INUes using their undocumented protocol."""
|
||||||
|
|
||||||
# import os
|
# import os
|
||||||
@@ -40,8 +40,8 @@ CLEANUP = arguments.cleanup
|
|||||||
@dataclass
|
@dataclass
|
||||||
class INUeCommand():
|
class INUeCommand():
|
||||||
"""Command to be sent to an INUe, including the context and possible value"""
|
"""Command to be sent to an INUe, including the context and possible value"""
|
||||||
context: str = ""
|
context: str
|
||||||
command: str = ""
|
command: str
|
||||||
position: int = 0
|
position: int = 0
|
||||||
value: int = None
|
value: int = None
|
||||||
reverse: bool = False
|
reverse: bool = False
|
||||||
@@ -126,15 +126,6 @@ class Worker(threading.Thread):
|
|||||||
]
|
]
|
||||||
|
|
||||||
elif CLEANUP:
|
elif CLEANUP:
|
||||||
commands = [
|
|
||||||
INUeCommand("Slot%s_I" % rstp_dac, "ceConfigNmsVid", 0, VLAN),
|
|
||||||
INUeCommand("Terminal_I", "ipConfigAdEntAddress", rstp_dac + 1, new_ip),
|
|
||||||
INUeCommand("Terminal_I", "ipConfigAdEntNetMask", rstp_dac + 1, NET_MASK),
|
|
||||||
INUeCommand("Terminal_I", "ipConfigAutoroutingOspfEnable", rstp_dac + 1, 2),
|
|
||||||
INUeCommand("Terminal_I", "ipCidrRouteIfIndex", rstp_dac + 48, GATEWAY, True),
|
|
||||||
]
|
|
||||||
|
|
||||||
else:
|
|
||||||
commands = [
|
commands = [
|
||||||
INUeCommand("Slot%s_I" % rstp_dac, "ceConfigNmsVid", 0, 0),
|
INUeCommand("Slot%s_I" % rstp_dac, "ceConfigNmsVid", 0, 0),
|
||||||
INUeCommand("Terminal_I", "ipConfigAdEntAddress", rstp_dac + 1, '0.0.0.0'),
|
INUeCommand("Terminal_I", "ipConfigAdEntAddress", rstp_dac + 1, '0.0.0.0'),
|
||||||
@@ -143,6 +134,15 @@ class Worker(threading.Thread):
|
|||||||
# INUeCommand("Terminal_I", "ipCidrRouteIfIndex", rstp_dac + 48, GATEWAY, True),
|
# INUeCommand("Terminal_I", "ipCidrRouteIfIndex", rstp_dac + 48, GATEWAY, True),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
else:
|
||||||
|
commands = [
|
||||||
|
INUeCommand("Slot%s_I" % rstp_dac, "ceConfigNmsVid", 0, VLAN),
|
||||||
|
INUeCommand("Terminal_I", "ipConfigAdEntAddress", rstp_dac + 1, new_ip),
|
||||||
|
INUeCommand("Terminal_I", "ipConfigAdEntNetMask", rstp_dac + 1, NET_MASK),
|
||||||
|
INUeCommand("Terminal_I", "ipConfigAutoroutingOspfEnable", rstp_dac + 1, 2),
|
||||||
|
INUeCommand("Terminal_I", "ipCidrRouteIfIndex", rstp_dac + 48, GATEWAY, True),
|
||||||
|
]
|
||||||
|
|
||||||
fail = False
|
fail = False
|
||||||
|
|
||||||
for command in commands:
|
for command in commands:
|
||||||
|
|||||||
Reference in New Issue
Block a user