Skip to content

Commit 368a939

Browse files
committed
fix(network): remove unused allocate floating ip feature (#30)
1 parent a247a6e commit 368a939

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/openstack_mcp_server/tools/network_tools.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def register_tools(self, mcp: FastMCP):
4444
mcp.tool()(self.toggle_port_admin_state)
4545
mcp.tool()(self.get_floating_ips)
4646
mcp.tool()(self.create_floating_ip)
47-
mcp.tool()(self.allocate_floating_ip_pool_to_project)
4847
mcp.tool()(self.attach_floating_ip_to_port)
4948
mcp.tool()(self.detach_floating_ip_from_port)
5049
mcp.tool()(self.delete_floating_ip)
@@ -418,7 +417,7 @@ def toggle_subnet_dhcp(self, subnet_id: str) -> Subnet:
418417
current = conn.network.get_subnet(subnet_id)
419418
subnet = conn.network.update_subnet(
420419
subnet_id,
421-
enable_dhcp=not current.enable_dhcp,
420+
enable_dhcp=False if current.enable_dhcp else True,
422421
)
423422
return self._convert_to_subnet_model(subnet)
424423

@@ -852,27 +851,6 @@ def create_floating_ip(
852851
ip = conn.network.create_ip(**ip_args)
853852
return self._convert_to_floating_ip_model(ip)
854853

855-
def allocate_floating_ip_pool_to_project(
856-
self,
857-
floating_network_id: str,
858-
project_id: str,
859-
) -> None:
860-
"""
861-
Allocate Floating IP pool (external network access) to a project via RBAC.
862-
863-
:param floating_network_id: External network ID
864-
:param project_id: Target project ID
865-
:return: None
866-
"""
867-
conn = get_openstack_conn()
868-
conn.network.create_rbac_policy(
869-
object_type="network",
870-
object_id=floating_network_id,
871-
action="access_as_external",
872-
target_project_id=project_id,
873-
)
874-
return None
875-
876854
def attach_floating_ip_to_port(
877855
self,
878856
floating_ip_id: str,

0 commit comments

Comments
 (0)