Merge "AdminUtils: Fix security-group migrate"

This commit is contained in:
Jenkins 2017-05-14 08:57:58 +00:00 committed by Gerrit Code Review
commit 062e9bb2c2

View File

@ -401,10 +401,11 @@ def migrate_sg_to_policy(resource, event, trigger, **kwargs):
{'nsx': nsx_sg_id, 'pol': policy_id})
plugin._update_nsx_security_group_policies(
policy_id, None, nsx_sg_id)
prop = plugin._get_security_group_properties(context_, sg_id)
with context_.session.begin(subtransactions=True):
prop.update({sg_policy.POLICY: policy_id})
prop = context_.session.query(
extended_secgroup.NsxExtendedSecurityGroupProperties).\
filter_by(security_group_id=sg_id).one()
prop[sg_policy.POLICY] = policy_id
LOG.info("Done.")