Validate CIDR given as ip-prefix in security-group-rule-create
There was no validation for the provided ip prefix. This just adds
a simple parse using netaddr and explodes with appropriate message.
Also makes sure ip prefix _is_ cidr (192.168.1.1-->192.168.1.1/32).
Validation occurs at the attribute level (API model) as well as at
the db level, where the ethertype is validated against the ip_prefix
address type.
Unit test cases added - bad prefix, unmasked prefix and incorrect
ethertype. Also adds attribute test cases for the added
convert_ip_prefix_to_cidr method
Reviewed: https:/ /review. openstack. org/88057 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=03eed8cd34c d4fb043c11fc99f 6bb0b4fbd5728d
Committed: https:/
Submitter: Jenkins
Branch: stable/havana
commit 03eed8cd34cd4fb 043c11fc99f6bb0 b4fbd5728d
Author: marios <email address hidden>
Date: Fri Nov 29 18:23:54 2013 +0200
Validate CIDR given as ip-prefix in security- group-rule- create
There was no validation for the provided ip prefix. This just adds 1.1-->192. 168.1.1/ 32).
a simple parse using netaddr and explodes with appropriate message.
Also makes sure ip prefix _is_ cidr (192.168.
Validation occurs at the attribute level (API model) as well as at
the db level, where the ethertype is validated against the ip_prefix
address type.
Unit test cases added - bad prefix, unmasked prefix and incorrect ip_prefix_ to_cidr method
ethertype. Also adds attribute test cases for the added
convert_
Closes-Bug: 1255338
Conflicts: tests/unit/ test_security_ groups_ rpc.py tests/unit/ test_extension_ security_ group.py
neutron/
neutron/
Change-Id: I71fb8c887963a1 22a5bd8cfdda800 026c1cd3954 8413f359b008256 10cdf66607)
(cherry picked from commit 65aa92b0348b7ab