nsx_v3: Move db access in update_port under same update transaction

Change-Id: I576aa62cf776bfa75c8dcb6d019796260856dc48
This commit is contained in:
Aaron Rosen 2016-02-25 12:39:02 -08:00
parent 56be50105f
commit 0c2cda0859

View File

@ -977,12 +977,13 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
parent_tag=tag)
def update_port(self, context, id, port):
original_port = super(NsxV3Plugin, self).get_port(context, id)
_, nsx_lport_id = nsx_db.get_nsx_switch_and_port_id(
context.session, id)
switch_profile_ids = None
with context.session.begin(subtransactions=True):
original_port = super(NsxV3Plugin, self).get_port(context, id)
_, nsx_lport_id = nsx_db.get_nsx_switch_and_port_id(
context.session, id)
updated_port = super(NsxV3Plugin, self).update_port(context,
id, port)