Merge pull request #45 from samiam/fix_empty_volumes

Correctly handle empty dangling volumes
This commit is contained in:
Kyle Anderson 2018-03-05 09:59:26 -08:00 committed by GitHub
commit 49e1bdfe3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 10 deletions

View File

@ -1,5 +1,6 @@
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: 'v0.4.2'
rev: v1.2.3
hooks:
- id: check-added-large-files
- id: check-docstring-first

View File

@ -1,8 +1,12 @@
language: python
env:
- TOXENV=py27
- TOXENV=py33
- TOXENV=py34
matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 3.5
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
install:
- pip install tox
script:

View File

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

View File

@ -1,5 +1,5 @@
[tox]
envlist = py27,py33,py34
envlist = py27,py35,py36
[testenv]
deps =
@ -9,5 +9,6 @@ deps =
pytest
commands =
py.test {posargs:tests}
pre-commit autoupdate
pre-commit install -f --install-hooks
pre-commit run --all-files