Skip to content

Commit

Permalink
Change containers to list if string
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ken'ichi Ohmichi authored and gmannos committed Jan 1, 2018
1 parent e3075a1 commit 88cd149
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tempest/api/object_storage/base.py
Expand Up @@ -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'}
Expand Down

0 comments on commit 88cd149

Please sign in to comment.