Merge "Fix incorrect NotImplementedError"
This commit is contained in:
commit
1154891caa
@ -271,7 +271,7 @@ class RouterPluginBase(object):
|
||||
pass
|
||||
|
||||
def get_routers_count(self, context, filters=None):
|
||||
raise qexception.NotImplementedError()
|
||||
raise NotImplementedError()
|
||||
|
||||
def get_floatingips_count(self, context, filters=None):
|
||||
raise qexception.NotImplementedError()
|
||||
raise NotImplementedError()
|
||||
|
@ -1092,11 +1092,9 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||
|
||||
def update_network(self, context, id, network):
|
||||
pnet._raise_if_updates_provider_attributes(network['network'])
|
||||
if network["network"].get("admin_state_up"):
|
||||
if network['network']["admin_state_up"] is False:
|
||||
raise q_exc.NotImplementedError(_("admin_state_up=False "
|
||||
"networks are not "
|
||||
"supported."))
|
||||
if network["network"].get("admin_state_up") is False:
|
||||
raise NotImplementedError(_("admin_state_up=False networks "
|
||||
"are not supported."))
|
||||
with context.session.begin(subtransactions=True):
|
||||
net = super(NvpPluginV2, self).update_network(context, id, network)
|
||||
if psec.PORTSECURITY in network['network']:
|
||||
|
@ -362,6 +362,15 @@ class TestNiciraNetworksV2(test_plugin.TestNetworksV2,
|
||||
self.assertEqual(webob.exc.HTTPServiceUnavailable.code,
|
||||
res.status_int)
|
||||
|
||||
def test_update_network_with_admin_false(self):
|
||||
data = {'network': {'admin_state_up': False}}
|
||||
with self.network() as net:
|
||||
plugin = manager.NeutronManager.get_plugin()
|
||||
self.assertRaises(NotImplementedError,
|
||||
plugin.update_network,
|
||||
context.get_admin_context(),
|
||||
net['network']['id'], data)
|
||||
|
||||
|
||||
class NiciraPortSecurityTestCase(psec.PortSecurityDBTestCase):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user