From: Jakub Libosvar Date: Tue, 21 Jul 2015 11:17:18 +0000 (+0000) Subject: QoS: Remove type attribute from QoS rules X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=fd0bf111838b90dcf76d670987770835904810fb;p=openstack-build%2Fneutron-build.git QoS: Remove type attribute from QoS rules The type is given by object itself. We don't specify type when creating resource cause it's a part of uri. This patch allows a bandwidth_limit_rule to be created in given policy. Partially-Implements: blueprint quantum-qos-api Change-Id: Ica4626083054200e3b82bef23984462e7c596e1e --- diff --git a/neutron/extensions/qos.py b/neutron/extensions/qos.py index 1c89acac1..76b9f6f8a 100644 --- a/neutron/extensions/qos.py +++ b/neutron/extensions/qos.py @@ -37,9 +37,6 @@ QOS_RULE_COMMON_FIELDS = { 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, - 'type': {'allow_post': True, 'allow_put': True, 'is_visible': True, - 'default': '', - 'validate': {'type:values': VALID_RULE_TYPES}}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'required_by_policy': True, 'is_visible': True}, diff --git a/neutron/objects/qos/rule.py b/neutron/objects/qos/rule.py index 0b5713e73..b2bdd93f4 100644 --- a/neutron/objects/qos/rule.py +++ b/neutron/objects/qos/rule.py @@ -32,6 +32,7 @@ class QosRule(base.NeutronObject): fields = { 'id': obj_fields.UUIDField(), + #TODO(QoS): We ought to kill the `type' attribute 'type': obj_fields.StringField(), 'qos_policy_id': obj_fields.UUIDField() } diff --git a/neutron/tests/tempest/services/network/json/network_client.py b/neutron/tests/tempest/services/network/json/network_client.py index bbee87341..a95443294 100644 --- a/neutron/tests/tempest/services/network/json/network_client.py +++ b/neutron/tests/tempest/services/network/json/network_client.py @@ -657,8 +657,8 @@ class NetworkClientJSON(service_client.ServiceClient): post_data = self.serialize( {'bandwidth_limit_rule': { 'max_kbps': max_kbps, - 'max_burst_kbps': max_burst_kbps, - 'type': 'bandwidth_limit'}}) + 'max_burst_kbps': max_burst_kbps} + }) resp, body = self.post(uri, post_data) self.expected_success(201, resp.status) body = json.loads(body) @@ -687,8 +687,8 @@ class NetworkClientJSON(service_client.ServiceClient): post_data = { 'bandwidth_limit_rule': { 'max_kbps': max_kbps, - 'max_burst_kbps': max_burst_kbps, - 'type': 'bandwidth_limit'}} + 'max_burst_kbps': max_burst_kbps} + } resp, body = self.put(uri, json.dumps(post_data)) self.expected_success(200, resp.status) return service_client.ResponseBody(resp, body)