Troublehsooting INUeCommand class

This commit is contained in:
Adrian Woodley
2019-07-23 00:13:28 +08:00
parent 43eda55c57
commit 55cef3aa1b

View File

@@ -43,6 +43,7 @@ class INUeCommand():
def get_context(self): def get_context(self):
"""Get the context of the command, ready to send.""" """Get the context of the command, ready to send."""
print ("contextid %s\n" % self.context).encode('ascii')
return ("contextid %s\n" % self.context).encode('ascii') return ("contextid %s\n" % self.context).encode('ascii')
def get_command(self): def get_command(self):
@@ -67,7 +68,7 @@ def send_config(telnet, inue_command):
response = telnet.read_until(b'\n').split() response = telnet.read_until(b'\n').split()
if response[0].decode() == inue_command.command: if response[0].decode() == inue_command.command:
return response[-1] return response[-1]
else:
return False return False
@@ -91,7 +92,6 @@ class Worker(threading.Thread):
def run(self): def run(self):
while 1: while 1:
inue = self.__inues.get() inue = self.__inues.get()
print(inue)
if inue is None: if inue is None:
self.__passed.put(None) self.__passed.put(None)
self.__failed.put(None) self.__failed.put(None)