]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
QoS extension fixes
authorJohn Schwarz <jschwarz@redhat.com>
Thu, 2 Jul 2015 09:32:05 +0000 (12:32 +0300)
committerIhar Hrachyshka <ihrachys@redhat.com>
Thu, 2 Jul 2015 21:08:37 +0000 (21:08 +0000)
This patch introduces small fixes to the QoS extensions:
1. Adding a common tenant_id field for QoS API calls.
2. Making sure the function interface is correct.

Co-Authored-By: Irena Berezovsky <irenab.dev@gmail.com>
Change-Id: If9c7a7b9b8a5d2367d8f3225fbf07d8e3ec8865d

neutron/extensions/qos.py
neutron/services/qos/qos_plugin.py

index 3979ccc8aa8d1022314783ad817609cc25fbb5d1..396a1c089335f8fa958e1ae91ede13322bfd9f9c 100644 (file)
@@ -38,7 +38,10 @@ QOS_RULE_COMMON_FIELDS = {
     '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},
+}
 
 RESOURCE_ATTRIBUTE_MAP = {
     'policies': {
@@ -193,11 +196,11 @@ class QoSPluginBase(service_base.ServicePluginBase):
         pass
 
     @abc.abstractmethod
-    def create_policy(self, context, qos_policy):
+    def create_policy(self, context, policy):
         pass
 
     @abc.abstractmethod
-    def update_policy(self, context, policy_id, qos_policy):
+    def update_policy(self, context, policy_id, policy):
         pass
 
     @abc.abstractmethod
@@ -217,12 +220,13 @@ class QoSPluginBase(service_base.ServicePluginBase):
         pass
 
     @abc.abstractmethod
-    def create_policy_bandwidth_limit_rule(self, context, policy_id, rule):
+    def create_policy_bandwidth_limit_rule(self, context, policy_id,
+                                           bandwidth_limit_rule):
         pass
 
     @abc.abstractmethod
     def update_policy_bandwidth_limit_rule(self, context, rule_id,
-                                           policy_id, rule):
+                                           policy_id, bandwidth_limit_rule):
         pass
 
     @abc.abstractmethod
index a60abcc72371fc447c4c6613b335c7cdbee6dd81..dec35a9865de59fa865c3247fa29cdc7c805645d 100644 (file)
@@ -138,10 +138,10 @@ class QoSPlugin(qos.QoSPluginBase):
         #            extension of resources
         pass
 
-    def create_policy(self, context, qos_policy):
+    def create_policy(self, context, policy):
         pass
 
-    def update_policy(self, context, policy_id, qos_policy):
+    def update_policy(self, context, policy_id, policy):
         pass
 
     def delete_policy(self, context, policy_id):
@@ -155,11 +155,12 @@ class QoSPlugin(qos.QoSPluginBase):
                      page_reverse=False):
         pass
 
-    def create_policy_bandwidth_limit_rule(self, context, policy_id, rule):
+    def create_policy_bandwidth_limit_rule(self, context, policy_id,
+                                           bandwidth_limit_rule):
         pass
 
     def update_policy_bandwidth_limit_rule(self, context, rule_id,
-                                           policy_id, rule):
+                                           policy_id, bandwidth_limit_rule):
         pass
 
     def get_policy_bandwidth_limit_rule(self, context, rule_id,