Ensure task_id is a native string on py3

Change-Id: I4f4ae8f9d1248feaca5b9181fc72e5b44e1eed4e
This commit is contained in:
Tim Burke 2019-11-08 00:08:42 +00:00 committed by Kota Tsuyuzaki
parent 236aaf2894
commit ba5aa7cdb8
1 changed files with 2 additions and 0 deletions

View File

@ -657,6 +657,8 @@ class StorletInvocationProtocol(object):
self._wait_for_read_with_timeout(self.taskid_read_fd)
# TODO(kota_): need an assertion for task_id format
self.task_id = os.read(self.taskid_read_fd, 10)
if not isinstance(self.task_id, str):
self.task_id = self.task_id.decode('utf-8')
os.close(self.taskid_read_fd)
def _send_execute_command(self):