diff options
| author | Kai Qiang Wu(Kennan) <wkq5325@gmail.com> | 2015-08-31 04:14:17 +0000 |
|---|---|---|
| committer | Kai Qiang Wu(Kennan) <wkq5325@gmail.com> | 2015-08-31 05:13:59 +0000 |
| commit | da68e2eccc3c4207ddacc4c887645447579d4fd2 (patch) | |
| tree | ec0246aa23203d70d9a1de88cc7d7c70ecfb6263 /tools/cleanup-images | |
| parent | 5f621a4fe900d41f7f11497cac21875da3280386 (diff) | |
| download | kolla-ansible-da68e2eccc3c4207ddacc4c887645447579d4fd2.tar.gz kolla-ansible-da68e2eccc3c4207ddacc4c887645447579d4fd2.zip | |
Improve scripts with some check before kick rm command
Closes-Bug: #1490387
Change-Id: I4a9476085b9c5b2cae3801e5b1954e85068f4e03
Diffstat (limited to 'tools/cleanup-images')
| -rwxr-xr-x | tools/cleanup-images | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/cleanup-images b/tools/cleanup-images index c0b1db55c..871afd1d1 100755 --- a/tools/cleanup-images +++ b/tools/cleanup-images @@ -6,4 +6,9 @@ cd "$(dirname "$REAL_PATH")/.." . tools/validate-docker-execute -docker rmi $@ $(docker images -a -q) +IMAGES=`docker images -a -q` +if [[ -z "$IMAGES" ]]; then + echo "No images to cleanup, exit now." + exit 0 +fi +docker rmi $@ $IMAGES |
