Skip to content

Commit

Permalink
Validate L3 inputs.
Browse files Browse the repository at this point in the history
Fixes bug 1064765

Change-Id: Idb8d078f3c640d450bcb738cddf875b5e49f1b60
  • Loading branch information
Gary Kotton committed Nov 10, 2012
1 parent 49f649c commit c01a839
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions quantum/extensions/l3.py
Expand Up @@ -78,6 +78,7 @@ def _validate_uuid_or_none(data, valid_values=None):
'validate': {'type:regex': attr.UUID_PATTERN},
'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,
Expand All @@ -88,19 +89,23 @@ def _validate_uuid_or_none(data, valid_values=None):
'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:regex': attr.UUID_PATTERN},
'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},
Expand All @@ -110,6 +115,7 @@ def _validate_uuid_or_none(data, valid_values=None):
'is_visible': True, 'default': None},
'tenant_id': {'allow_post': True, 'allow_put': False,
'required_by_policy': True,
'validate': {'type:string': None},
'is_visible': True}
},
}
Expand Down

0 comments on commit c01a839

Please sign in to comment.