Be more idiomatic in testing for volumes

This commit is contained in:
Sam 2018-03-02 17:10:38 -05:00
parent e17dd441be
commit 9aaa244b68

View File

@ -76,9 +76,7 @@ def get_all_images(client):
def get_dangling_volumes(client):
log.info("Getting dangling volumes")
volumes = client.volumes({'dangling': True})['Volumes']
if volumes == None:
volumes = []
volumes = client.volumes({'dangling': True})['Volumes'] or []
log.info("Found %s dangling volumes", len(volumes))
return volumes