Added OSPF and CLEANUP
This commit is contained in:
@@ -29,8 +29,14 @@ ARG_PARSER = argparse.ArgumentParser(
|
|||||||
ARG_PARSER.add_argument('--in', action="store", dest="in_file", required=True)
|
ARG_PARSER.add_argument('--in', action="store", dest="in_file", required=True)
|
||||||
ARG_PARSER.add_argument('--out', action="store", dest="out_file", default="passed.csv")
|
ARG_PARSER.add_argument('--out', action="store", dest="out_file", default="passed.csv")
|
||||||
ARG_PARSER.add_argument('--area', action="store", dest="ospf_area", default=None)
|
ARG_PARSER.add_argument('--area', action="store", dest="ospf_area", default=None)
|
||||||
|
ARG_PARSER.add_argument('--cleanup', action="store_true")
|
||||||
arguments = ARG_PARSER.parse_args()
|
arguments = ARG_PARSER.parse_args()
|
||||||
|
|
||||||
|
INFILEPATH = arguments.in_file
|
||||||
|
OUTFILEPATH = arguments.out_file
|
||||||
|
OSPF_AREA = arguments.ospf_area
|
||||||
|
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"""
|
||||||
@@ -114,13 +120,28 @@ class Worker(threading.Thread):
|
|||||||
self.__failed.put(inue)
|
self.__failed.put(inue)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
commands = [
|
if OSPF_AREA:
|
||||||
INUeCommand("Slot%s_I" % rstp_dac, "ceConfigNmsVid", 0, VLAN),
|
commands = [
|
||||||
INUeCommand("Terminal_I", "ipConfigAdEntAddress", rstp_dac + 1, new_ip),
|
INUeCommand("Terminal_I", "ipConfigOspfAreaId", 1, OSPF_AREA)
|
||||||
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 if 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'),
|
||||||
|
INUeCommand("Terminal_I", "ipConfigAdEntNetMask", rstp_dac + 1, '0.0.0.0'),
|
||||||
|
# INUeCommand("Terminal_I", "ipConfigAutoroutingOspfEnable", rstp_dac + 1, 2),
|
||||||
|
# INUeCommand("Terminal_I", "ipCidrRouteIfIndex", rstp_dac + 48, GATEWAY, True),
|
||||||
|
]
|
||||||
|
|
||||||
fail = False
|
fail = False
|
||||||
|
|
||||||
@@ -215,22 +236,6 @@ INUE_QUEUE = queue.Queue(0)
|
|||||||
PASSED_QUEUE = queue.Queue(0)
|
PASSED_QUEUE = queue.Queue(0)
|
||||||
FAILED_QUEUE = queue.Queue(0)
|
FAILED_QUEUE = queue.Queue(0)
|
||||||
|
|
||||||
# for i in range(WORKERS):
|
|
||||||
# Worker(INUE_QUEUE, PASSED_QUEUE, FAILED_QUEUE).start()
|
|
||||||
|
|
||||||
# for INUE in sys.argv:
|
|
||||||
# if NEXT:
|
|
||||||
# NEXT=0
|
|
||||||
# else:
|
|
||||||
# INUE_QUEUE.put(INUE)
|
|
||||||
|
|
||||||
# for i in range(WORKERS):
|
|
||||||
# INUE_QUEUE.put(None)
|
|
||||||
|
|
||||||
# INFILEPATH = sys.argv[1]
|
|
||||||
INFILEPATH = arguments.in_file
|
|
||||||
OUTFILEPATH = arguments.out_file
|
|
||||||
|
|
||||||
input_inues()
|
input_inues()
|
||||||
|
|
||||||
for worker in range(WORKERS):
|
for worker in range(WORKERS):
|
||||||
|
|||||||
Reference in New Issue
Block a user