Public bug reported: When subnets are created using a cidr the value provided is normalized/converted to a proper subnet
https://opendev.org/openstack/neutron/src/branch/master/neutron/db/db_base_plugin_v2.py#L818-L820 818 # turn the CIDR into a proper subnet 819 net = netaddr.IPNetwork(s['cidr']) 820 subnet['subnet']['cidr'] = '%s/%s' % (net.network, net.prefixlen) I.e if the user create using `192.168.100.1/24` as the cidr the subnet create is successfull. The cidr is turned into the proper subnet `192.168.100.0/24` internally in the pre-commit. When listing subnets and filtering using the same value for the cidr the return is an empty list. Example: $ curl -s -H "X-Auth-Token: $(openstack token issue -c id -f value)" -H "Content-Type: application/json" http://192.168.122.103:9696/v2.0/subnets?cidr=192.168.100.1/24 | json_reformat { "subnets": [ ] } A user should be able to find the subnet by filtering using the same `192.168.100.1/24` value used when creating the subnet. ** Affects: neutron Importance: Undecided Status: New ** Tags: queens-backport-potential -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1831811 Title: Unable to filter using same cidr value as used for subnet create Status in neutron: New Bug description: When subnets are created using a cidr the value provided is normalized/converted to a proper subnet https://opendev.org/openstack/neutron/src/branch/master/neutron/db/db_base_plugin_v2.py#L818-L820 818 # turn the CIDR into a proper subnet 819 net = netaddr.IPNetwork(s['cidr']) 820 subnet['subnet']['cidr'] = '%s/%s' % (net.network, net.prefixlen) I.e if the user create using `192.168.100.1/24` as the cidr the subnet create is successfull. The cidr is turned into the proper subnet `192.168.100.0/24` internally in the pre-commit. When listing subnets and filtering using the same value for the cidr the return is an empty list. Example: $ curl -s -H "X-Auth-Token: $(openstack token issue -c id -f value)" -H "Content-Type: application/json" http://192.168.122.103:9696/v2.0/subnets?cidr=192.168.100.1/24 | json_reformat { "subnets": [ ] } A user should be able to find the subnet by filtering using the same `192.168.100.1/24` value used when creating the subnet. To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1831811/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

