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
This commit is contained in:
Dan Wendlandt 2012-11-27 09:53:28 -08:00
parent 4a4626282b
commit 78eb1a0d53
3 changed files with 7 additions and 12 deletions

View 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()

View 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

View 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)