2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +00:00

Fix problem on disconnect from console session

After refactor, some bad codepath was left behind in confetty.  Address the
shortcoming.
This commit is contained in:
Jarrod Johnson 2014-03-06 19:49:46 -05:00
parent 65af925b2d
commit 83627938bb

View File

@ -205,8 +205,8 @@ def do_command(command, server):
elif argv[0] == 'start':
targpath = fullpath_target(argv[1])
currconsole = targpath
tlvdata.send(server, {'operation': 'start', 'path': targpath})
status = tlvdata.recv(server)
tlvdata.send(session.connection, {'operation': 'start', 'path': targpath})
status = tlvdata.recv(session.connection)
if 'error' in status:
if 'errorcode' in status:
exitcode = status['errorcode']
@ -302,10 +302,9 @@ def exit(code=0):
fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, currfl ^ os.O_NONBLOCK)
termios.tcsetattr(sys.stdin.fileno(), termios.TCSANOW, oldtcattr)
if consoleonly:
server.shutdown(socket.SHUT_RDWR)
sys.exit(code)
else:
tlvdata.send(server, {'operation': 'stop', 'path': currconsole})
tlvdata.send(session.connection, {'operation': 'stop', 'path': currconsole})
inconsole = False
def conserver_command(fh, command):