From 792a94f323a882245863c5ec9d47ec09bedd43cc Mon Sep 17 00:00:00 2001 From: justin ljj Date: Thu, 30 Aug 2012 13:12:15 +0800 Subject: [PATCH] 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 --- etc/policy.json | 2 -- quantum/api/v2/attributes.py | 4 ---- quantum/tests/unit/test_api_v2.py | 4 +--- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/etc/policy.json b/etc/policy.json index f53080cc54..52feddf922 100644 --- a/etc/policy.json +++ b/etc/policy.json @@ -32,11 +32,9 @@ "create_port": [], "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"]], "get_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"]], "delete_port": [["rule:admin_or_owner"]] } diff --git a/quantum/api/v2/attributes.py b/quantum/api/v2/attributes.py index 46a9bc8415..0aee016097 100644 --- a/quantum/api/v2/attributes.py +++ b/quantum/api/v2/attributes.py @@ -220,10 +220,6 @@ RESOURCE_ATTRIBUTE_MAP = { 'default': ATTR_NOT_SPECIFIED, 'enforce_policy': 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, 'default': '', 'is_visible': True}, diff --git a/quantum/tests/unit/test_api_v2.py b/quantum/tests/unit/test_api_v2.py index 621a257fab..6e271385b5 100644 --- a/quantum/tests/unit/test_api_v2.py +++ b/quantum/tests/unit/test_api_v2.py @@ -494,13 +494,11 @@ class JSONV2TestCase(APIv2TestBase): full_input = {'port': {'admin_state_up': True, 'mac_address': attributes.ATTR_NOT_SPECIFIED, 'fixed_ips': attributes.ATTR_NOT_SPECIFIED, - 'device_owner': '', - 'host_routes': attributes.ATTR_NOT_SPECIFIED}} + 'device_owner': ''}} full_input['port'].update(initial_input['port']) return_value = {'id': _uuid(), 'status': 'ACTIVE', 'admin_state_up': True, 'mac_address': 'ca:fe:de:ad:be:ef', - 'host_routes': [], 'device_id': device_id, 'device_owner': ''} return_value.update(initial_input['port'])