Cleanup projects in reverse order
Commit 0a592b4 introduced a change where a hierarchy of projects
is created. Of course, the parent project is created before the
child project. The project cleanup code was deleting projects in
the order that they're created. Keystone doesn't allow deleting the
parent before the children so this was causing the project to be
left around (the DELETE operation was failing but cleanup failures
are ignored).
The fix here is to do the cleanups in reverse order so that the
child is deleted before the parent.
Change-Id: Id7422967ccb666966fbce5a175db5e128b2d3df7
Closes-Bug: 1595638
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index e6a22b0..9187e23 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -240,7 +240,7 @@
self._try_wrapper(self.users_client.delete_user, user)
for tenant in self.tenants:
self._try_wrapper(self.projects_client.delete_tenant, tenant)
- for project in self.projects:
+ for project in reversed(self.projects):
self._try_wrapper(self.projects_client.delete_project, project)
for role in self.roles:
self._try_wrapper(self.roles_client.delete_role, role)