diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index b026f3a22..b0cbdc69a 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -147,19 +147,19 @@ class PypoFetch(Thread): @staticmethod def telnet_send(logger, lock, commands): try: - lock.acquire() + lock.acquire() - tn = telnetlib.Telnet(LS_HOST, LS_PORT) - for i in commands: - logger.info(i) - tn.write(i) + tn = telnetlib.Telnet(LS_HOST, LS_PORT) + for i in commands: + logger.info(i) + tn.write(i) - tn.write('exit\n') - tn.read_all() - except Exception, e: - logger.error(str(e)) - finally: - lock.release() + tn.write('exit\n') + tn.read_all() + except Exception, e: + logger.error(str(e)) + finally: + lock.release() @staticmethod