Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
tests/test_model.py | 4 ++--
tests/test_model_storagevolume.py | 2 +-
tests/test_rest.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/test_model.py b/tests/test_model.py
index bd195b5..ad0dccd 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -829,9 +829,9 @@ def test_vm_clone(self):
# and make sure both of them complete successfully
task1 = inst.vm_clone(name)
task2 = inst.vm_clone(name)
- clone1_name = task1['target_uri'].split('/')[-1]
+ clone1_name = task1['target_uri'].split('/')[-2]
rollback.prependDefer(inst.vm_delete, clone1_name)
- clone2_name = task2['target_uri'].split('/')[-1]
+ clone2_name = task2['target_uri'].split('/')[-2]
rollback.prependDefer(inst.vm_delete, clone2_name)
inst.task_wait(task1['id'])
task1 = inst.task_lookup(task1['id'])
diff --git a/tests/test_model_storagevolume.py b/tests/test_model_storagevolume.py
index a3c3ce3..11fd90d 100644
--- a/tests/test_model_storagevolume.py
+++ b/tests/test_model_storagevolume.py
@@ -124,7 +124,7 @@ def _task_lookup(taskid):
resp = self.request(vol_uri + '/clone', '{}',
'POST')
self.assertEquals(202, resp.status)
task = json.loads(resp.read())
- cloned_vol_name = task['target_uri'].split('/')[-1]
+ cloned_vol_name = task['target_uri'].split('/')[-2]
rollback.prependDefer(model.storagevolume_delete, pool_name,
cloned_vol_name)
wait_task(_task_lookup, task['id'])
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 686d54c..65c3db5 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -292,7 +292,7 @@ def test_vm_lifecycle(self):
wait_task(self._task_lookup, task['id'])
task = json.loads(self.request('/tasks/%s' % task['id'],
'{}').read())
self.assertEquals('finished', task['status'])
- clone_vm_name = task['target_uri'].split('/')[-1]
+ clone_vm_name = task['target_uri'].split('/')[-2]
self.assertTrue(re.match(u'test-vm-clone-\d+', clone_vm_name))
resp = self.request('/vms/test-vm', '{}')
--
2.1.0