]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Add validity checks to Quantum v2 resources
authorGary Kotton <gkotton@redhat.com>
Tue, 17 Jul 2012 08:52:20 +0000 (04:52 -0400)
committerGary Kotton <gkotton@redhat.com>
Wed, 18 Jul 2012 14:38:49 +0000 (10:38 -0400)
commit4605dff64fb2fac764e58baf397f2e6811216ec4
tree2dd37fa3bf8bf513af32c535adb59651067e0cf2
parentf8f4615c5884991ee8f76b33511fb4f14d6df43b
Add validity checks to Quantum v2 resources

Fixes bug 1015148

The code enable defining validity checks for input variables. This
is done via callback functions per type. The following types are supported:
    - type:values - checks that data is valid according to a list of values
    - type:mac_address - checks that data is a valid mac address
    - type:ip_address - checks that data is a valid ip address
    - type:subnet - checks that data is a valid cidr
    - type:regex - checks that data matches a regular expression (for
      example checking UUID validity)

Change-Id: Iaa694cbfe3c518a5cd3951271853fe986106e7f5
quantum/api/v2/attributes.py [new file with mode: 0644]
quantum/api/v2/base.py
quantum/api/v2/router.py
quantum/db/db_base_plugin_v2.py
quantum/tests/unit/test_api_v2.py
quantum/tests/unit/test_db_plugin.py