[Kimchi-devel] [PATCH 4/5] Update rollback_wrapper function to handle nested API

Aline Manera alinefm at linux.vnet.ibm.com
Thu Jan 22 14:36:52 UTC 2015


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 at 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




More information about the Kimchi-devel mailing list