From 88cd14961f06f370abea7e2b625556d28dd15421 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Thu, 21 Dec 2017 10:39:13 -0800 Subject: [PATCH] Change containers to list if string delete_containers() expects containers should be list, but the method is used for cleanup and it is easy to miss if a string value is passed instead of list. This patch changes the method can cover a string case. Change-Id: Ice9dafa5555e78dc68dc69e82acfd05b894492c1 --- tempest/api/object_storage/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py index ee7216354f..e8f3f8b850 100644 --- a/tempest/api/object_storage/base.py +++ b/tempest/api/object_storage/base.py @@ -36,10 +36,14 @@ def delete_containers(containers, container_client, object_client): using HA proxy sync the deletion properly, otherwise, the container might fail to be deleted because it's not empty. - :param containers: List of containers to be deleted + :param containers: List of containers(or string of a container) + to be deleted :param container_client: Client to be used to delete containers :param object_client: Client to be used to delete objects """ + if isinstance(containers, str): + containers = [containers] + for cont in containers: try: params = {'limit': 9999, 'format': 'json'}