From 348508a4514d82ff33c9624cdd6ec739fc22ba93 Mon Sep 17 00:00:00 2001 From: philogicae Date: Tue, 27 Aug 2024 19:22:11 +0300 Subject: [PATCH] Fix optional trusted_exec --- src/aleph/sdk/client/authenticated_http.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/aleph/sdk/client/authenticated_http.py b/src/aleph/sdk/client/authenticated_http.py index f84b97ca..6e1d39ad 100644 --- a/src/aleph/sdk/client/authenticated_http.py +++ b/src/aleph/sdk/client/authenticated_http.py @@ -540,15 +540,18 @@ async def create_instance( # Default to the QEMU hypervisor for instances. selected_hypervisor: HypervisorType = hypervisor or HypervisorType.qemu + environment_kwargs = dict( + internet=internet, + aleph_api=aleph_api, + hypervisor=selected_hypervisor, + ) + if trusted_execution: + environment_kwargs["trusted_execution"] = trusted_execution + content = InstanceContent( address=address, allow_amend=allow_amend, - environment=InstanceEnvironment( - internet=internet, - aleph_api=aleph_api, - hypervisor=selected_hypervisor, - trusted_execution=trusted_execution, - ), + environment=InstanceEnvironment(**environment_kwargs), variables=environment_variables, resources=MachineResources( vcpus=vcpus,