Comment 3 for bug 1670230

Revision history for this message
songminglong (songminglong) wrote :

actually, i have read the part of codes of update_subnetpool(), and subnetpool do not support "openstack subnet pool unset" command. subnetpool just support to enlarge prefies operation:

if new_prefixes is not constants.ATTR_NOT_SPECIFIED:
    orig_ip_set = netaddr.IPSet(orig_pool.prefixes)
    new_ip_set = netaddr.IPSet(new_prefixes)
    if not orig_ip_set.issubset(new_ip_set):
        msg = _("Existing prefixes must be "
                "a subset of the new prefixes")
        raise n_exc.IllegalSubnetPoolPrefixUpdate(msg=msg)
    new_ip_set.compact()
    updated['prefixes'] = [str(prefix.cidr)
                           for prefix in new_ip_set.iter_cidrs()]

orig_ip_set is original prefixes in database which you want to update
new_ip_set is prefixes you input from cli

the operation of updating subnetpool prefixes is just allow you to enlarge range of existing prefixes, for example:
orig_ip_set=['10.0.1.0/24','10.0.2.0/24']
new_ip_set is super set of orig_ip_set, like ['10.0.1.0/24','10.0.2.0/24','10.0.3.0'/24]
so if you want to enlarge subnetpool prefixes:
openstack subnet pool set subnetpool_id --pool-prefix 10.0.1.0/24 --pool-prefix 10.0.2.0/24 --pool-prefix 10.0.3.0/24

it's a little of absurd, haha