Weird object shit happening
This commit is contained in:
@@ -31,8 +31,8 @@ ARG_PARSER.add_argument('csv')
|
||||
@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
|
||||
@@ -44,7 +44,7 @@ class INUeCommand():
|
||||
|
||||
def get_context(self):
|
||||
"""Get the context of the command, ready to send."""
|
||||
print ("contextid %s\n" % self.context).encode('ascii')
|
||||
print (self.context)
|
||||
return ("contextid %s\n" % self.context).encode('ascii')
|
||||
|
||||
def get_command(self):
|
||||
@@ -104,7 +104,7 @@ class Worker(threading.Thread):
|
||||
|
||||
try:
|
||||
with telnetlib.Telnet(inue, PORT) as telnet:
|
||||
for slot in range(1, 9):
|
||||
for slot in range(1, 10):
|
||||
print("Slot: %s" % slot)
|
||||
if send_config(telnet,
|
||||
INUeCommand("Slot%s_I" % slot, "ceConfigBridgeStpMode")):
|
||||
@@ -115,11 +115,11 @@ class Worker(threading.Thread):
|
||||
continue
|
||||
|
||||
commands = [
|
||||
INUeCommand("Slot%s_I" % slot, "ceConfigNmsVid", 0, VLAN),
|
||||
INUeCommand("Terminal_I", "ipConfigAdEntAddress", slot + 1, new_ip),
|
||||
INUeCommand("Terminal_I", "ipConfigAdEntelnetET_MASK", slot + 1, NET_MASK),
|
||||
INUeCommand("Terminal_I", "ipConfigAutoroutingOspfEnable", slot + 1, 2),
|
||||
INUeCommand("Terminal_I", "ipCidrRouteIfIndex", slot + 48, GATEWAY, True),
|
||||
INUeCommand("Slot%s_I" % rstp_dac, "ceConfigNmsVid", 0, VLAN),
|
||||
INUeCommand("Terminal_I", "ipConfigAdEntAddress", rstp_dac + 1, new_ip),
|
||||
INUeCommand("Terminal_I", "ipConfigAdEntelnetET_MASK", rstp_dac + 1, NET_MASK),
|
||||
INUeCommand("Terminal_I", "ipConfigAutoroutingOspfEnable", rstp_dac + 1, 2),
|
||||
INUeCommand("Terminal_I", "ipCidrRouteIfIndex", rstp_dac + 48, GATEWAY, True),
|
||||
]
|
||||
|
||||
fail = False
|
||||
|
||||
Reference in New Issue
Block a user