Skip to content

Commit

Permalink
fix: update base64 decoding method for compatibility with Python 3
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Styk <[email protected]>
  • Loading branch information
StykMartin committed Oct 28, 2024
1 parent 4aff1ea commit 4ee22b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions LabController/src/bkr/labcontroller/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def recipe_upload_file(self,
logger.debug("recipe_upload_file recipe_id:%s name:%s offset:%s size:%s",
recipe_id, name, offset, size)
with self.log_storage.recipe(str(recipe_id), os.path.join(path, name)) as log_file:
log_file.update_chunk(base64.decodestring(data), int(offset or 0))
log_file.update_chunk(base64.b64decode(data), int(offset or 0))
return True

def task_result(self,
Expand Down Expand Up @@ -622,7 +622,7 @@ def task_upload_file(self,
logger.debug("task_upload_file task_id:%s name:%s offset:%s size:%s",
task_id, name, offset, size)
with self.log_storage.task(str(task_id), os.path.join(path, name)) as log_file:
log_file.update_chunk(base64.decodestring(data), int(offset or 0))
log_file.update_chunk(base64.b64decode(data), int(offset or 0))
return True

def task_start(self,
Expand Down Expand Up @@ -719,7 +719,7 @@ def result_upload_file(self,
logger.debug("result_upload_file result_id:%s name:%s offset:%s size:%s",
result_id, name, offset, size)
with self.log_storage.result(str(result_id), os.path.join(path, name)) as log_file:
log_file.update_chunk(base64.decodestring(data), int(offset or 0))
log_file.update_chunk(base64.b64decode(data), int(offset or 0))
return True

def push(self, fqdn, inventory):
Expand Down

0 comments on commit 4ee22b8

Please sign in to comment.