From 760416360c867c87b78faeb7c8eda4b5081c440d Mon Sep 17 00:00:00 2001 From: Adrian Woodley Date: Tue, 23 Jul 2019 03:15:13 +0800 Subject: [PATCH] Reversed CLEANUP --- aviat_config.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/aviat_config.py b/aviat_config.py index 0629802..32d3ec6 100755 --- a/aviat_config.py +++ b/aviat_config.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.7 +#!/usr/bin/python3 """Programmatically configure Aviat INUes using their undocumented protocol.""" # import os @@ -40,8 +40,8 @@ CLEANUP = arguments.cleanup @dataclass class INUeCommand(): """Command to be sent to an INUe, including the context and possible value""" - context: str = "" - command: str = "" + context: str + command: str position: int = 0 value: int = None reverse: bool = False @@ -126,15 +126,6 @@ class Worker(threading.Thread): ] 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 = [ INUeCommand("Slot%s_I" % rstp_dac, "ceConfigNmsVid", 0, 0), INUeCommand("Terminal_I", "ipConfigAdEntAddress", rstp_dac + 1, '0.0.0.0'), @@ -142,6 +133,15 @@ class Worker(threading.Thread): # INUeCommand("Terminal_I", "ipConfigAutoroutingOspfEnable", rstp_dac + 1, 2), # 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