Ensure that max_attempts is set
The NsxLibApiBase can have the nsxlib_config passed as None. In order to use the retry logic we retrieve the max_attempts from the client object. This is always set. Change-Id: I4ac60f9a3d89b60d9b35390825578cb7f849dfa8
This commit is contained in:
@@ -386,7 +386,7 @@ class NsxLibApiBase(object):
|
|||||||
# it again with the new revision_id
|
# it again with the new revision_id
|
||||||
@retry_upon_exception(
|
@retry_upon_exception(
|
||||||
nsxlib_exceptions.StaleRevision,
|
nsxlib_exceptions.StaleRevision,
|
||||||
max_attempts=self.nsxlib_config.max_attempts)
|
max_attempts=self.client.max_attempts)
|
||||||
def do_update():
|
def do_update():
|
||||||
return self._internal_update_resource(
|
return self._internal_update_resource(
|
||||||
resource, payload,
|
resource, payload,
|
||||||
@@ -410,7 +410,7 @@ class NsxLibApiBase(object):
|
|||||||
# Using internal method so we can access max_attempts in the decorator
|
# Using internal method so we can access max_attempts in the decorator
|
||||||
@retry_upon_exception(
|
@retry_upon_exception(
|
||||||
nsxlib_exceptions.StaleRevision,
|
nsxlib_exceptions.StaleRevision,
|
||||||
max_attempts=self.nsxlib_config.max_attempts)
|
max_attempts=self.client.max_attempts)
|
||||||
def _do_delete():
|
def _do_delete():
|
||||||
self.client.delete(self.get_path(resource))
|
self.client.delete(self.get_path(resource))
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ class NsxLibApiBase(object):
|
|||||||
# Using internal method so we can access max_attempts in the decorator
|
# Using internal method so we can access max_attempts in the decorator
|
||||||
@retry_upon_exception(
|
@retry_upon_exception(
|
||||||
nsxlib_exceptions.StaleRevision,
|
nsxlib_exceptions.StaleRevision,
|
||||||
max_attempts=self.nsxlib_config.max_attempts)
|
max_attempts=self.client.max_attempts)
|
||||||
def _do_create():
|
def _do_create():
|
||||||
return self.client.create(resource, body, headers=headers)
|
return self.client.create(resource, body, headers=headers)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user