From f8d26b4f8f08d3ab23ec0c457388006bd20df6d7 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 19 Apr 2019 17:28:45 -0500 Subject: [PATCH] Fix some issues with progress "socket" workaround for batches --- tailbone/views/batch/core.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index f3dc00f3..d30c41f4 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -868,6 +868,8 @@ class BatchMasterView(MasterView): # strip suffix, interpret data as JSON data = data[:-len(suffix)] + if six.PY3: + data = data.decode('utf_8') data = json.loads(data) if data.get('everything_complete'): @@ -934,6 +936,7 @@ class BatchMasterView(MasterView): ], subcommand='{}-batch'.format(action), subcommand_args=[ + '--batch-type', self.handler.batch_key, batch_uuid, ]) @@ -956,9 +959,12 @@ class BatchMasterView(MasterView): suffix = "\n\n.".encode('utf_8') cxn = socket.create_connection(('127.0.0.1', port)) - cxn.send(json.dumps({ + data = json.dumps({ 'everything_complete': True, - })) + }) + if six.PY3: + data = data.encode('utf_8') + cxn.send(data) cxn.send(suffix) cxn.close()