Fix cleanup with empty volumes
TrivialFix Change-Id: I7b23bf6793cfb0c2b552cfc5b255ebf67eaa4fec
This commit is contained in:
parent
af51dca89d
commit
735209c105
@ -108,14 +108,17 @@ def remove_all_containers():
|
||||
@docker_utils.DockerClient()
|
||||
def remove_all_volumes(dc):
|
||||
"""Remove all volumes created for containers run by Mesos."""
|
||||
if dc.volumes()['Volumes'] is not None:
|
||||
volume_names = six.moves.map(operator.itemgetter('Name'),
|
||||
dc.volumes()['Volumes'])
|
||||
for volume_name in volume_names:
|
||||
# TODO(nihilifer): Provide a more intelligent filtering for Mesos infra
|
||||
# volumes.
|
||||
# TODO(nihilifer): Provide a more intelligent filtering for Mesos
|
||||
# infra volumes.
|
||||
if 'zookeeper' not in volume_name:
|
||||
LOG.info("Removing volume %s", volume_name)
|
||||
dc.remove_volume(volume_name)
|
||||
else:
|
||||
LOG.info("No docker volumes found")
|
||||
|
||||
|
||||
def cleanup():
|
||||
|
Loading…
Reference in New Issue
Block a user