diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index 430e95dd14..7b8f16b7db 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -2468,7 +2468,8 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): source_groups=[source] if source else None, dest_groups=[destination] if destination else None, scope=scope, - direction=direction, logged=logging) + direction=direction, logged=logging, + tag=sg_rule.get('project_id')) def create_security_group(self, context, security_group, default_sg=False): secgroup = security_group['security_group'] diff --git a/vmware_nsx/tests/unit/extensions/test_provider_security_groups.py b/vmware_nsx/tests/unit/extensions/test_provider_security_groups.py index ae4e655c10..09c263f2bb 100644 --- a/vmware_nsx/tests/unit/extensions/test_provider_security_groups.py +++ b/vmware_nsx/tests/unit/extensions/test_provider_security_groups.py @@ -422,4 +422,5 @@ class TestNSXpProviderSecurityGrp(test_nsxp_plugin.NsxPPluginTestCaseMixin, source_groups=mock.ANY, dest_groups=mock.ANY, scope=scope, - logged=False) + logged=False, + tag=rule_data['project_id']) diff --git a/vmware_nsx/tests/unit/nsx_p/test_plugin.py b/vmware_nsx/tests/unit/nsx_p/test_plugin.py index d37eef6729..42bcceb15b 100644 --- a/vmware_nsx/tests/unit/nsx_p/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_p/test_plugin.py @@ -1305,7 +1305,8 @@ class NsxPTestSecurityGroup(common_v3.FixExternalNetBaseTest, source_groups=mock.ANY, dest_groups=mock.ANY, scope=scope, - logged=False) + logged=False, + tag=mock.ANY) def test_create_security_group_rule_with_remote_group(self): with self.security_group() as sg1, self.security_group() as sg2: