diff --git a/src/aleph/handlers/content/vm.py b/src/aleph/handlers/content/vm.py index 8c37b633..4a422962 100644 --- a/src/aleph/handlers/content/vm.py +++ b/src/aleph/handlers/content/vm.py @@ -122,7 +122,7 @@ def _map_content_to_db_model(item_hash, content): if content.environment.trusted_execution is not None: trusted_execution_policy = content.environment.trusted_execution.policy trusted_execution_firmware = content.environment.trusted_execution.firmware - if hasattr(content.requirements.node, 'node_hash'): + if hasattr(content, "requirements") and hasattr(content.requirements.node, 'node_hash'): node_hash = content.requirements.node.node_hash return db_cls( diff --git a/tests/message_processing/test_process_instances.py b/tests/message_processing/test_process_instances.py index 2cc1259d..2078d696 100644 --- a/tests/message_processing/test_process_instances.py +++ b/tests/message_processing/test_process_instances.py @@ -306,8 +306,8 @@ async def test_process_instance( ) assert rootfs.size_mib == content_dict["rootfs"]["size_mib"] assert rootfs.persistence == content_dict["rootfs"]["persistence"] - assert len(instance.volumes) == 5 + assert instance.node_hash is None volumes_by_type = { type: list(volumes_iter)