
That way the rollback_wrapper function can also be used for nested APIs, which requires more than one parameter. For example, the storage volumes (/storagepool/<pool>/storagevolumes/<vol>) Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 7e70f2a..2a8929f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -233,9 +233,9 @@ def wait_task(task_lookup, taskid, timeout=10): # the element has been deleted if test finishes correctly, then NofFoundError # exception is raised and rollback breaks. To avoid it, this wrapper ignores # the NotFoundError. -def rollback_wrapper(func, resource): +def rollback_wrapper(func, resource, *args): try: - func(resource) + func(resource, *args) except NotFoundError: # VM has been deleted already return -- 2.1.0