]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
fix so cisco plugin db model to not override count methods
authorDan Wendlandt <dan@nicira.com>
Tue, 27 Nov 2012 17:53:28 +0000 (09:53 -0800)
committerDan Wendlandt <dan@nicira.com>
Tue, 27 Nov 2012 17:53:28 +0000 (09:53 -0800)
bug 1083696

also fixes bug 1083180, which has L3 plugin base class implement
get_*_count methods and raise
NotImplemented, which is the "right" thing to do from a
code-as-documentation perspective.

Change-Id: I0367953bcea930b1ca70e416d3de22eeea1aa99d

quantum/extensions/l3.py
quantum/plugins/cisco/models/virt_phy_sw_v2.py
quantum/tests/unit/test_l3_plugin.py

index 5071333471814f97a6052ea72ee3a92b97c0d4bf..15542d31aef29acfbc29352b09ba0b1753af4971 100644 (file)
@@ -249,3 +249,9 @@ class RouterPluginBase(object):
     @abstractmethod
     def get_floatingips(self, context, filters=None, fields=None):
         pass
+
+    def get_routers_count(self, context, filters=None):
+        raise qexception.NotImplementedError()
+
+    def get_floatingips_count(self, context, filters=None):
+        raise qexception.NotImplementedError()
index 1586c0016f8b46985f4c4094940eed40991faef1..1d6622e5e0d90d777386a02dd185e459b1209860 100644 (file)
@@ -289,10 +289,6 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
         """For this model this method will be delegated to vswitch plugin"""
         pass
 
-    def get_networks_count(self, context, filters=None):
-        """For this model this method will be delegated to vswitch plugin"""
-        pass
-
     def create_port(self, context, port):
         """For this model this method will be delegated to vswitch plugin"""
         pass
@@ -305,10 +301,6 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
         """For this model this method will be delegated to vswitch plugin"""
         pass
 
-    def get_ports_count(self, context, filters=None):
-        """For this model this method will be delegated to vswitch plugin"""
-        pass
-
     def update_port(self, context, id, port):
         """For this model this method will be delegated to vswitch plugin"""
         pass
@@ -336,7 +328,3 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
     def get_subnets(self, context, filters=None, fields=None):
         """For this model this method will be delegated to vswitch plugin"""
         pass
-
-    def get_subnets_count(self, context, filters=None):
-        """For this model this method will be delegated to vswitch plugin"""
-        pass
index f171878854f134dfe69e4dae95e22c93d6add1d2..fe0a0b600189f272766a9593c155a1a5346bc1c7 100644 (file)
@@ -117,6 +117,7 @@ class L3NatExtensionTestCase(unittest.TestCase):
 
         instance = self.plugin.return_value
         instance.create_router.return_value = return_value
+        instance.get_routers_count.return_value = 0
 
         res = self.api.post_json(_get_path('routers'), data)