diff --git a/vmware_nsxlib/v3/policy/core_resources.py b/vmware_nsxlib/v3/policy/core_resources.py index 9a7f8196..baf27507 100644 --- a/vmware_nsxlib/v3/policy/core_resources.py +++ b/vmware_nsxlib/v3/policy/core_resources.py @@ -1317,12 +1317,19 @@ class NsxPolicyTier1Api(NsxPolicyResourceBase): def remove_edge_cluster(self, tier1_id, tenant=constants.POLICY_INFRA_TENANT): """Reset the path in the locale-service (deleting it is not allowed)""" - t1service_def = core_defs.Tier1LocaleServiceDef( - tier1_id=tier1_id, - service_id=self._locale_service_id(tier1_id), - edge_cluster_path="", - tenant=tenant) - self.policy_api.create_or_update(t1service_def) + + @utils.retry_upon_exception( + exceptions.StaleRevision, + max_attempts=self.policy_api.client.max_attempts) + def do_remove_edge_cluster(tier1_id, tenant): + t1service_def = core_defs.Tier1LocaleServiceDef( + tier1_id=tier1_id, + service_id=self._locale_service_id(tier1_id), + edge_cluster_path="", + tenant=tenant) + self.policy_api.create_or_update(t1service_def) + + do_remove_edge_cluster(tier1_id, tenant) def get_edge_cluster_path(self, tier1_id, tenant=constants.POLICY_INFRA_TENANT):