From aea39af4e28b4c134409a22d183140d1d2353e37 Mon Sep 17 00:00:00 2001 From: Martin Styk Date: Mon, 28 Oct 2024 20:16:40 +0100 Subject: [PATCH] fix: use six.text_type for unicode compatibility Signed-off-by: Martin Styk --- LabController/src/bkr/labcontroller/provision.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LabController/src/bkr/labcontroller/provision.py b/LabController/src/bkr/labcontroller/provision.py index 9476df773..e0c7417d4 100644 --- a/LabController/src/bkr/labcontroller/provision.py +++ b/LabController/src/bkr/labcontroller/provision.py @@ -27,6 +27,9 @@ from bkr.labcontroller import netboot import utils +import six + + logger = logging.getLogger(__name__) class CommandQueuePoller(ProxyHelper): @@ -175,7 +178,7 @@ def handle(self, command, predecessors): except netboot.ImageFetchingError as e: logger.exception('Error processing command %s', command['id']) # It's not the system's fault so don't mark it as broken - self.mark_command_failed(command['id'], unicode(e), False) + self.mark_command_failed(command['id'], six.text_type(e), False) except Exception as e: logger.exception('Error processing command %s', command['id']) self.mark_command_failed(command['id'],