Merge "Use correct session in update_allocation_pools" into stable/mitaka
This commit is contained in:
commit
8759c269b5
|
@ -374,7 +374,7 @@ class NeutronDbSubnet(ipam_base.Subnet):
|
|||
# Pools have already been validated in the subnet request object which
|
||||
# was sent to the subnet pool driver. Further validation should not be
|
||||
# required.
|
||||
session = db_api.get_session()
|
||||
session = self._context.session
|
||||
self.subnet_manager.delete_allocation_pools(session)
|
||||
self.create_allocation_pools(self.subnet_manager, session, pools, cidr)
|
||||
self._pools = pools
|
||||
|
|
|
@ -4155,6 +4155,16 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
|
|||
res = self.deserialize(self.fmt, req.get_response(self.api))
|
||||
self.assertIsNone(data['subnet']['gateway_ip'])
|
||||
|
||||
def test_subnet_usable_after_update(self):
|
||||
with self.subnet() as subnet:
|
||||
data = {'subnet': {'name': 'newname'}}
|
||||
req = self.new_update_request('subnets', data,
|
||||
subnet['subnet']['id'])
|
||||
res = self.deserialize(self.fmt, req.get_response(self.api))
|
||||
self.assertEqual(data['subnet']['name'], res['subnet']['name'])
|
||||
with self.port(subnet=subnet):
|
||||
pass
|
||||
|
||||
def test_update_subnet(self):
|
||||
with self.subnet() as subnet:
|
||||
data = {'subnet': {'gateway_ip': '10.0.0.1'}}
|
||||
|
|
Loading…
Reference in New Issue