diff --git a/src/openstack_mcp_server/tools/block_storage_tools.py b/src/openstack_mcp_server/tools/block_storage_tools.py index d682ebd..f6ba641 100644 --- a/src/openstack_mcp_server/tools/block_storage_tools.py +++ b/src/openstack_mcp_server/tools/block_storage_tools.py @@ -39,7 +39,7 @@ def get_volumes(self) -> list[Volume]: VolumeAttachment( server_id=attachment.get("server_id"), device=attachment.get("device"), - attachment_id=attachment.get("id"), + attachment_id=attachment.get("attachment_id"), ), ) @@ -80,7 +80,7 @@ def get_volume_details(self, volume_id: str) -> Volume: VolumeAttachment( server_id=attachment.get("server_id"), device=attachment.get("device"), - attachment_id=attachment.get("id"), + attachment_id=attachment.get("attachment_id"), ), ) diff --git a/tests/tools/test_block_storage_tools.py b/tests/tools/test_block_storage_tools.py index 305f66e..63237cd 100644 --- a/tests/tools/test_block_storage_tools.py +++ b/tests/tools/test_block_storage_tools.py @@ -299,12 +299,12 @@ def test_get_volume_details_with_attachments( { "server_id": "server-123", "device": "/dev/vdb", - "id": "attach-1", + "attachment_id": "attach-1", }, { "server_id": "server-456", "device": "/dev/vdc", - "id": "attach-2", + "attachment_id": "attach-2", }, ]