diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2015-12-17 15:00:17 +0100 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2015-12-17 15:00:17 +0100 |
commit | f2814075fad177f884298bbcdb474642cf3bb044 (patch) | |
tree | 10a26212c0459e0de0e0c93f6b40c7a89a7e1ab3 /testcases/VIM/OpenStack/CI/libraries/clean_openstack.py | |
parent | 6a9072400a0bc86b6b34584150bd0858b6834ac8 (diff) |
Fix bug clean_openstack if there are no users and tenants.
Change-Id: If750bfa3d9a090e8554d62b49907ac6d873d18e4
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/VIM/OpenStack/CI/libraries/clean_openstack.py')
-rw-r--r-- | testcases/VIM/OpenStack/CI/libraries/clean_openstack.py | 8 |
1 files changed, 8 insertions, 0 deletions
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') |