Skip to content

Commit 045f385

Browse files
author
René Moser
authored
floating_ip: Fix identify by IP (#37)
1 parent c0d26bf commit 045f385

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cloudscale_cli/commands/floating_ip.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import click
22

3+
def normalize_network_id(network_id):
4+
return network_id.split('/')[0]
5+
36
@click.group()
47
@click.pass_context
58
def floating_ip(ctx):
@@ -35,7 +38,7 @@ def cmd_list(cloudscale, filter_tag, filter_json, delete, force):
3538
@click.pass_obj
3639
def cmd_show(cloudscale, network_id):
3740
cloudscale.cmd_show(
38-
uuid=network_id,
41+
uuid=normalize_network_id(network_id),
3942
)
4043

4144
@click.option('--ip-version', type=int, default=4, show_default=True)
@@ -74,7 +77,7 @@ def cmd_create(cloudscale, ip_version, server_uuid, prefix_length, reverse_ptr,
7477
@click.pass_obj
7578
def cmd_update(cloudscale, network_id, server_uuid, reverse_ptr, tags, clear_tags, clear_all_tags):
7679
cloudscale.cmd_update(
77-
uuid=network_id,
80+
uuid=normalize_network_id(network_id),
7881
tags=tags,
7982
clear_tags=clear_tags,
8083
clear_all_tags=clear_all_tags,
@@ -98,6 +101,6 @@ def cmd_assign(cloudscale, network_id, server_uuid):
98101
@click.pass_obj
99102
def cmd_delete(cloudscale, network_id, force):
100103
cloudscale.cmd_delete(
101-
uuid=network_id,
104+
uuid=normalize_network_id(network_id),
102105
force=force,
103106
)

0 commit comments

Comments
 (0)