]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Validate L3 inputs.
authorGary Kotton <gkotton@redhat.com>
Wed, 7 Nov 2012 22:57:59 +0000 (22:57 +0000)
committerGary Kotton <gkotton@redhat.com>
Wed, 7 Nov 2012 22:57:59 +0000 (22:57 +0000)
Fixes bug 1064765

Change-Id: Idb8d078f3c640d450bcb738cddf875b5e49f1b60

quantum/extensions/l3.py

index f7e0e35c732ae685b79374fa72823f457be2d604..ccd3a2ec11956d0f9fc4bd0143c1c3a5bef4c747 100644 (file)
@@ -78,6 +78,7 @@ RESOURCE_ATTRIBUTE_MAP = {
                'validate': {'type:uuid': None},
                'is_visible': True},
         'name': {'allow_post': True, 'allow_put': True,
+                 'validate': {'type:string': None},
                  'is_visible': True, 'default': ''},
         'admin_state_up': {'allow_post': True, 'allow_put': True,
                            'default': True,
@@ -88,19 +89,23 @@ RESOURCE_ATTRIBUTE_MAP = {
                    'is_visible': True},
         'tenant_id': {'allow_post': True, 'allow_put': False,
                       'required_by_policy': True,
+                      'validate': {'type:string': None},
                       'is_visible': True},
         'external_gateway_info': {'allow_post': True, 'allow_put': True,
                                   'is_visible': True, 'default': None}
     },
     'floatingips': {
         'id': {'allow_post': False, 'allow_put': False,
+               'validate': {'type:uuid': None},
                'is_visible': True},
         'floating_ip_address': {'allow_post': False, 'allow_put': False,
+                                'validate': {'type:ip_address_or_none': None},
                                 'is_visible': True},
         'floating_network_id': {'allow_post': True, 'allow_put': False,
                                 'validate': {'type:uuid': None},
                                 'is_visible': True},
         'router_id': {'allow_post': False, 'allow_put': False,
+                      'validate': {'type:uuid_or_none': None},
                       'is_visible': True, 'default': None},
         'port_id': {'allow_post': True, 'allow_put': True,
                     'validate': {'type:uuid_or_none': None},
@@ -110,6 +115,7 @@ RESOURCE_ATTRIBUTE_MAP = {
                              'is_visible': True, 'default': None},
         'tenant_id': {'allow_post': True, 'allow_put': False,
                       'required_by_policy': True,
+                      'validate': {'type:string': None},
                       'is_visible': True}
     },
 }