From: Dan Wendlandt Date: Tue, 27 Nov 2012 17:53:28 +0000 (-0800) Subject: fix so cisco plugin db model to not override count methods X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=78eb1a0d53f099e42e1ffb370da8561a0c5d35bb;p=openstack-build%2Fneutron-build.git fix so cisco plugin db model to not override count methods 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 --- diff --git a/quantum/extensions/l3.py b/quantum/extensions/l3.py index 507133347..15542d31a 100644 --- a/quantum/extensions/l3.py +++ b/quantum/extensions/l3.py @@ -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() diff --git a/quantum/plugins/cisco/models/virt_phy_sw_v2.py b/quantum/plugins/cisco/models/virt_phy_sw_v2.py index 1586c0016..1d6622e5e 100644 --- a/quantum/plugins/cisco/models/virt_phy_sw_v2.py +++ b/quantum/plugins/cisco/models/virt_phy_sw_v2.py @@ -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 diff --git a/quantum/tests/unit/test_l3_plugin.py b/quantum/tests/unit/test_l3_plugin.py index f17187885..fe0a0b600 100644 --- a/quantum/tests/unit/test_l3_plugin.py +++ b/quantum/tests/unit/test_l3_plugin.py @@ -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)