From f2814075fad177f884298bbcdb474642cf3bb044 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Thu, 17 Dec 2015 15:00:17 +0100 Subject: Fix bug clean_openstack if there are no users and tenants. Change-Id: If750bfa3d9a090e8554d62b49907ac6d873d18e4 Signed-off-by: jose.lausuch --- testcases/VIM/OpenStack/CI/libraries/clean_openstack.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'testcases/VIM/OpenStack/CI/libraries') diff --git a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py index ffc7082ad..844e923d1 100644 --- a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py +++ b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py @@ -254,6 +254,10 @@ def remove_security_groups(neutron_client): def remove_users(keystone_client): logger.info("Removing Users...") users = functest_utils.get_users(keystone_client) + if users == None: + logger.debug("There are no users in the deployment. ") + return + for user in users: user_name = getattr(user, 'name') user_id = getattr(user, 'id') @@ -272,6 +276,10 @@ def remove_users(keystone_client): def remove_tenants(keystone_client): logger.info("Removing Tenants...") tenants = functest_utils.get_tenants(keystone_client) + if tenants == None: + logger.debug("There are no tenants in the deployment. ") + return + for tenant in tenants: tenant_name=getattr(tenant, 'name') tenant_id = getattr(tenant, 'id') -- cgit 1.2.3-korg