From f277859cf5097446288d943fa00f21340b341cda Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 5 Oct 2023 13:16:42 +0200 Subject: [PATCH] Fix: Set Item hash of the VM as string and enconding as bytes to be able to use it on b32encode function. --- vm_supervisor/vm/firecracker/instance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm_supervisor/vm/firecracker/instance.py b/vm_supervisor/vm/firecracker/instance.py index be4f886ba..7831eec7d 100644 --- a/vm_supervisor/vm/firecracker/instance.py +++ b/vm_supervisor/vm/firecracker/instance.py @@ -237,7 +237,7 @@ def _create_network_file(self) -> bytes: def _create_metadata_file(self) -> bytes: """Creates metadata configuration file for cloud-init tool""" - hostname = base64.b32encode(self.vm_hash).decode().strip("=").lower() + hostname = base64.b32encode(str.encode(self.vm_hash)).decode().strip("=").lower() metadata = { "instance-id": f"iid-instance-{self.vm_id}",