From f570c651bf915c4ba25c1b3319f7212df1743b6a Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Wed, 27 Jun 2018 16:05:33 +0300 Subject: [PATCH] NSX|V3 fix global SG creation duplication In commit I0775e284f21012a01298168d5ca3dd1c74b95f05 we mocked the db retry in order to prevent duplications in global SG creation causeing the plugin to fail. The mocked api was not enough, and should be replaces by teh oslo_db api to cover all cases. Change-Id: I31dfc519fc52c31d861352763b5b4d62adcbccea --- vmware_nsx/plugins/nsx_v3/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 64efe64b22..1873b3120b 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -353,7 +353,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, try: # ensure that the global default is created, and only once # without retrying on DB errors - with mock.patch("neutron.db.api.is_retriable", + with mock.patch("oslo_db.api.wrap_db_retry." + "_is_exception_expected", return_value=False): super(NsxV3Plugin, self).create_security_group( context, sec_group, True)