From a5865b176304b92736a71cd6ad2dd1199c588ba5 Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Tue, 4 Sep 2018 17:52:46 +0200 Subject: Partially Revert "Add command to unset information from Subnet-pools" We do not support removing a prefix from a subnet pool, only updating with a larger prefix (which is handled by the set command) This reverts commit 063c722a110031883e9615064092644de6df8da2. Change-Id: I11224fbdb94dc1caef42a8a64cbcebaf1dc542fe Story: #1670230 Task: #13697 --- openstackclient/network/v2/subnet_pool.py | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'openstackclient/network') diff --git a/openstackclient/network/v2/subnet_pool.py b/openstackclient/network/v2/subnet_pool.py index a5839868..d8541069 100644 --- a/openstackclient/network/v2/subnet_pool.py +++ b/openstackclient/network/v2/subnet_pool.py @@ -13,7 +13,6 @@ """Subnet pool action implementations""" -import copy import logging from osc_lib.cli import parseractions @@ -440,14 +439,6 @@ class UnsetSubnetPool(command.Command): def get_parser(self, prog_name): parser = super(UnsetSubnetPool, self).get_parser(prog_name) - parser.add_argument( - '--pool-prefix', - metavar='', - action='append', - dest='prefixes', - help=_('Remove subnet pool prefixes (in CIDR notation). ' - '(repeat option to unset multiple prefixes).'), - ) parser.add_argument( 'subnet_pool', metavar="", @@ -460,19 +451,5 @@ class UnsetSubnetPool(command.Command): client = self.app.client_manager.network obj = client.find_subnet_pool( parsed_args.subnet_pool, ignore_missing=False) - tmp_prefixes = copy.deepcopy(obj.prefixes) - attrs = {} - if parsed_args.prefixes: - for prefix in parsed_args.prefixes: - try: - tmp_prefixes.remove(prefix) - except ValueError: - msg = _( - "Subnet pool does not " - "contain prefix %s") % prefix - raise exceptions.CommandError(msg) - attrs['prefixes'] = tmp_prefixes - if attrs: - client.update_subnet_pool(obj, **attrs) # tags is a subresource and it needs to be updated separately. _tag.update_tags_for_unset(client, obj, parsed_args) -- cgit v1.2.1