From 1fd15bb2773d4ea0bc6a4b4f4726ea2cbadb3226 Mon Sep 17 00:00:00 2001 From: S0okJu Date: Mon, 22 Sep 2025 10:49:23 +0900 Subject: [PATCH] fix(block): Fix incorrect attachment_id(#71) - Change attachments property name 'id' to attachment_id in volume --- src/openstack_mcp_server/tools/block_storage_tools.py | 4 ++-- tests/tools/test_block_storage_tools.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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", }, ]