Merge "Use correct session in update_allocation_pools" into stable/mitaka

This commit is contained in:
Jenkins 2016-05-17 10:24:16 +00:00 committed by Gerrit Code Review
commit 8759c269b5
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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'}}