1+ from fastmcp import FastMCP
2+
3+ from .base import get_openstack_conn
14from .response .block_storage import (
25 Volume ,
36 VolumeAttachment ,
47)
5- from .base import get_openstack_conn
6- from fastmcp import FastMCP
78
89
910class BlockStorageTools :
@@ -39,7 +40,7 @@ def get_volumes(self) -> list[Volume]:
3940 server_id = attachment .get ("server_id" ),
4041 device = attachment .get ("device" ),
4142 attachment_id = attachment .get ("id" ),
42- )
43+ ),
4344 )
4445
4546 volume_list .append (
@@ -57,7 +58,7 @@ def get_volumes(self) -> list[Volume]:
5758 is_encrypted = volume .is_encrypted ,
5859 description = volume .description ,
5960 attachments = attachments ,
60- )
61+ ),
6162 )
6263
6364 return volume_list
@@ -80,7 +81,7 @@ def get_volume_details(self, volume_id: str) -> Volume:
8081 server_id = attachment .get ("server_id" ),
8182 device = attachment .get ("device" ),
8283 attachment_id = attachment .get ("id" ),
83- )
84+ ),
8485 )
8586
8687 return Volume (
@@ -133,7 +134,10 @@ def create_volume(
133134 volume_kwargs ["availability_zone" ] = availability_zone
134135
135136 volume = conn .block_storage .create_volume (
136- size = size , image = image , bootable = bootable , ** volume_kwargs
137+ size = size ,
138+ image = image ,
139+ bootable = bootable ,
140+ ** volume_kwargs ,
137141 )
138142
139143 volume_obj = Volume (
@@ -162,7 +166,11 @@ def delete_volume(self, volume_id: str, force: bool = False) -> None:
162166 """
163167 conn = get_openstack_conn ()
164168
165- conn .block_storage .delete_volume (volume_id , force = force , ignore_missing = False )
169+ conn .block_storage .delete_volume (
170+ volume_id ,
171+ force = force ,
172+ ignore_missing = False ,
173+ )
166174
167175 def extend_volume (self , volume_id : str , new_size : int ) -> None :
168176 """
@@ -174,4 +182,4 @@ def extend_volume(self, volume_id: str, new_size: int) -> None:
174182 """
175183 conn = get_openstack_conn ()
176184
177- conn .block_storage .extend_volume (volume_id , new_size )
185+ conn .block_storage .extend_volume (volume_id , new_size )
0 commit comments