diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-06-15 16:54:10 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-06-15 16:54:10 +0000 |
| commit | d3cd322650efeae7321bfe386e81a6697aebe5b0 (patch) | |
| tree | 3f62e99354c8f26529ee017aa3a5b87241f28aa0 /openstackclient/network/v2/floating_ip.py | |
| parent | 4cc539fcc53c09559c9bf0f8e06743a8077db197 (diff) | |
| parent | 8e2f49fbf22c242270c8162254fc83fbb4580a24 (diff) | |
| download | python-openstackclient-d3cd322650efeae7321bfe386e81a6697aebe5b0.tar.gz | |
Merge "Support bulk deletion for commands that exist in both network and compute."
Diffstat (limited to 'openstackclient/network/v2/floating_ip.py')
| -rw-r--r-- | openstackclient/network/v2/floating_ip.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/openstackclient/network/v2/floating_ip.py b/openstackclient/network/v2/floating_ip.py index c734c2ed..8fbf049e 100644 --- a/openstackclient/network/v2/floating_ip.py +++ b/openstackclient/network/v2/floating_ip.py @@ -110,26 +110,28 @@ class CreateFloatingIP(common.NetworkAndComputeShowOne): return (columns, data) -class DeleteFloatingIP(common.NetworkAndComputeCommand): - """Delete floating IP""" +class DeleteFloatingIP(common.NetworkAndComputeDelete): + """Delete floating IP(s)""" + + # Used by base class to find resources in parsed_args. + resource = 'floating_ip' + r = None def update_parser_common(self, parser): parser.add_argument( 'floating_ip', metavar="<floating-ip>", - help=_("Floating IP to delete (IP address or ID)") + nargs="+", + help=_("Floating IP(s) to delete (IP address or ID)") ) return parser def take_action_network(self, client, parsed_args): - obj = client.find_ip(parsed_args.floating_ip) + obj = client.find_ip(self.r, ignore_missing=False) client.delete_ip(obj) def take_action_compute(self, client, parsed_args): - obj = utils.find_resource( - client.floating_ips, - parsed_args.floating_ip, - ) + obj = utils.find_resource(client.floating_ips, self.r) client.floating_ips.delete(obj.id) |
