]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix update_port() so that it's done within the transaction
authorAaron Rosen <arosen@nicira.com>
Tue, 28 May 2013 19:49:20 +0000 (12:49 -0700)
committerAaron Rosen <arosen@nicira.com>
Tue, 28 May 2013 19:53:02 +0000 (12:53 -0700)
Fixes bug 1185152

Change-Id: I192991650a3562c73af550ec2288d1285412825c

quantum/db/db_base_plugin_v2.py

index 5a2f1525529328949595952e5ebfe8b85ca1b532..f7283cd32a945d92c4d0f987f092dbe8cac07e7f 100644 (file)
@@ -1379,9 +1379,9 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
                         ip_address=ip['ip_address'], subnet_id=ip['subnet_id'],
                         expiration=self._default_allocation_expiration())
                     context.session.add(allocated)
-        # Remove all attributes in p which are not in the port DB model
-        # and then update the port
-        port.update(self._filter_non_model_columns(p, models_v2.Port))
+            # Remove all attributes in p which are not in the port DB model
+            # and then update the port
+            port.update(self._filter_non_model_columns(p, models_v2.Port))
 
         return self._make_port_dict(port)