remove policy check for host_routes in update_port

Fixes bug 1043630

Port has no 'host_routes' attribute according to the latest V2 API
specification. So, policy check for 'host_routes' is not need any
more, just remove it in this patch.

Change-Id: I925e83d9825f89265843c15e71ee5ed4c33bad5f
This commit is contained in:
justin ljj 2012-08-30 13:12:15 +08:00
parent 398e176cf0
commit 8d75212460
3 changed files with 1 additions and 9 deletions

View File

@ -32,11 +32,9 @@
"create_port": [], "create_port": [],
"create_port:mac_address": [["rule:admin_or_network_owner"]], "create_port:mac_address": [["rule:admin_or_network_owner"]],
"create_port:host_routes": [["rule:admin_or_network_owner"]],
"create_port:fixed_ips": [["rule:admin_or_network_owner"]], "create_port:fixed_ips": [["rule:admin_or_network_owner"]],
"get_port": [["rule:admin_or_owner"]], "get_port": [["rule:admin_or_owner"]],
"update_port": [["rule:admin_or_owner"]], "update_port": [["rule:admin_or_owner"]],
"update_port:host_routes": [["rule:admin_or_network_owner"]],
"update_port:fixed_ips": [["rule:admin_or_network_owner"]], "update_port:fixed_ips": [["rule:admin_or_network_owner"]],
"delete_port": [["rule:admin_or_owner"]] "delete_port": [["rule:admin_or_owner"]]
} }

View File

@ -220,10 +220,6 @@ RESOURCE_ATTRIBUTE_MAP = {
'default': ATTR_NOT_SPECIFIED, 'default': ATTR_NOT_SPECIFIED,
'enforce_policy': True, 'enforce_policy': True,
'is_visible': True}, 'is_visible': True},
'host_routes': {'allow_post': True, 'allow_put': True,
'default': ATTR_NOT_SPECIFIED,
'enforce_policy': True,
'is_visible': False},
'device_id': {'allow_post': True, 'allow_put': True, 'device_id': {'allow_post': True, 'allow_put': True,
'default': '', 'default': '',
'is_visible': True}, 'is_visible': True},

View File

@ -494,13 +494,11 @@ class JSONV2TestCase(APIv2TestBase):
full_input = {'port': {'admin_state_up': True, full_input = {'port': {'admin_state_up': True,
'mac_address': attributes.ATTR_NOT_SPECIFIED, 'mac_address': attributes.ATTR_NOT_SPECIFIED,
'fixed_ips': attributes.ATTR_NOT_SPECIFIED, 'fixed_ips': attributes.ATTR_NOT_SPECIFIED,
'device_owner': '', 'device_owner': ''}}
'host_routes': attributes.ATTR_NOT_SPECIFIED}}
full_input['port'].update(initial_input['port']) full_input['port'].update(initial_input['port'])
return_value = {'id': _uuid(), 'status': 'ACTIVE', return_value = {'id': _uuid(), 'status': 'ACTIVE',
'admin_state_up': True, 'admin_state_up': True,
'mac_address': 'ca:fe:de:ad:be:ef', 'mac_address': 'ca:fe:de:ad:be:ef',
'host_routes': [],
'device_id': device_id, 'device_id': device_id,
'device_owner': ''} 'device_owner': ''}
return_value.update(initial_input['port']) return_value.update(initial_input['port'])