Add retry upon LB virtual server update conflicts
Change-Id: I7e117fbf2a1160415d6cdb56b6e9ead162bdf83c
This commit is contained in:
parent
ea2f4ea568
commit
8c81f73681
|
@ -22,10 +22,10 @@ import six
|
|||
from vmware_nsxlib._i18n import _
|
||||
from vmware_nsxlib.v3 import exceptions as nsxlib_exc
|
||||
from vmware_nsxlib.v3.policy import constants
|
||||
|
||||
from vmware_nsxlib.v3.policy.core_resources import IGNORE
|
||||
from vmware_nsxlib.v3.policy.core_resources import NsxPolicyResourceBase
|
||||
from vmware_nsxlib.v3.policy import lb_defs
|
||||
from vmware_nsxlib.v3 import utils
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -752,6 +752,11 @@ class NsxPolicyLoadBalancerVirtualServerAPI(NsxPolicyResourceBase):
|
|||
max_concurrent_connections=IGNORE,
|
||||
tags=IGNORE,
|
||||
tenant=constants.POLICY_INFRA_TENANT):
|
||||
|
||||
@utils.retry_upon_exception(
|
||||
nsxlib_exc.StaleRevision,
|
||||
max_attempts=self.policy_api.client.max_attempts)
|
||||
def _update():
|
||||
self._update(
|
||||
virtual_server_id=virtual_server_id,
|
||||
name=name,
|
||||
|
@ -770,6 +775,8 @@ class NsxPolicyLoadBalancerVirtualServerAPI(NsxPolicyResourceBase):
|
|||
max_concurrent_connections=max_concurrent_connections,
|
||||
tags=tags)
|
||||
|
||||
_update()
|
||||
|
||||
def update_virtual_server_with_pool(
|
||||
self, virtual_server_id, pool_id=IGNORE,
|
||||
tenant=constants.POLICY_INFRA_TENANT):
|
||||
|
|
Loading…
Reference in New Issue