Commit 5bddaab1 authored by Ad Schellevis's avatar Ad Schellevis

fix execute command test utility for configd

parent 7ac44e8c
...@@ -59,6 +59,7 @@ else: ...@@ -59,6 +59,7 @@ else:
if line: if line:
data = data + line data = data + line
# end of stream marker found, exit
if data.find("%c%c%c"%(chr(0),chr(0),chr(0))) > -1: if data.find("%c%c%c"%(chr(0),chr(0),chr(0))) > -1:
break break
......
...@@ -63,13 +63,19 @@ except socket.error, msg: ...@@ -63,13 +63,19 @@ except socket.error, msg:
try: try:
print ('send:%s '%exec_command) print ('send:%s '%exec_command)
sock.send(exec_command) sock.send(exec_command)
data = [] data = ""
while True: while True:
line = sock.recv(4096) line = sock.recv(4096)
if line: if line:
data.append(line) data = data + line
else:
# end of stream marker found, exit
if data.find("%c%c%c"%(chr(0),chr(0),chr(0))) > -1:
break break
print ('response:%s'% ''.join(data) )
print ('response:%s'% data[:-3] )
finally: finally:
sock.close() sock.close()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment