Fixing default security-group ingress rule
Change-Id: Ic03c3400307857d2327d8b2b3077e24c98b3f0fd
(cherry picked from commit 8c3a204ff4
)
This commit is contained in:
parent
697876d8b2
commit
1346282bb6
|
@ -1690,9 +1690,14 @@ class NsxVPluginV2(agents_db.AgentDbMixin,
|
|||
nsx_sg_id = nsx_db.get_nsx_security_group_id(
|
||||
context.session, rule['security_group_id'])
|
||||
|
||||
# Find the remote nsx security group id, if given in rule
|
||||
remote_nsx_sg_id = nsx_db.get_nsx_security_group_id(
|
||||
context.session, rule['remote_group_id'])
|
||||
# Find the remote nsx security group id, which might be the current
|
||||
# one. In case of the default security-group, the associated
|
||||
# nsx-security-group wasn't written to the database yet.
|
||||
if rule['remote_group_id'] == rule['security_group_id']:
|
||||
remote_nsx_sg_id = nsx_sg_id
|
||||
else:
|
||||
remote_nsx_sg_id = nsx_db.get_nsx_security_group_id(
|
||||
context.session, rule['remote_group_id'])
|
||||
|
||||
# Get source and destination containers from rule
|
||||
if rule['direction'] == 'ingress':
|
||||
|
|
Loading…
Reference in New Issue