mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 18:14:42 +00:00
fix execute command test utility for configd
This commit is contained in:
parent
7ac44e8c7b
commit
5bddaab1ca
@ -59,6 +59,7 @@ else:
|
||||
if line:
|
||||
data = data + line
|
||||
|
||||
# end of stream marker found, exit
|
||||
if data.find("%c%c%c"%(chr(0),chr(0),chr(0))) > -1:
|
||||
break
|
||||
|
||||
|
||||
@ -63,13 +63,19 @@ except socket.error, msg:
|
||||
try:
|
||||
print ('send:%s '%exec_command)
|
||||
sock.send(exec_command)
|
||||
data = []
|
||||
data = ""
|
||||
while True:
|
||||
line = sock.recv(4096)
|
||||
if line:
|
||||
data.append(line)
|
||||
else:
|
||||
data = data + line
|
||||
|
||||
# end of stream marker found, exit
|
||||
if data.find("%c%c%c"%(chr(0),chr(0),chr(0))) > -1:
|
||||
break
|
||||
print ('response:%s'% ''.join(data) )
|
||||
|
||||
print ('response:%s'% data[:-3] )
|
||||
finally:
|
||||
sock.close()
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user