summaryrefslogtreecommitdiffstats
path: root/lib/container/list
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-20 08:29:05 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-20 08:29:05 +0000
commitaeda6b2632606bf78f06ed9f1756b7ebd4fadf59 (patch)
treec1b8aa573e9f44311a082b095813d3f159b7639a /lib/container/list
parentFixing suffix in nwdiag output in container list command. (diff)
downloadcompute-tools-aeda6b2632606bf78f06ed9f1756b7ebd4fadf59.tar.xz
compute-tools-aeda6b2632606bf78f06ed9f1756b7ebd4fadf59.zip
Handling unreadable container directory properly in container list command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlib/container/list5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/container/list b/lib/container/list
index 76db901..da8a158 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -318,7 +318,10 @@ EOF
;;
esac
-CONTAINERS="$(cd "${MACHINES}" 2>/dev/null && find -maxdepth 1 -type d -and -not -name '.container-tools' -and -not -name 'container-tools' -and -not -name 'lost+found' -and -not -name '.snap' -and -not -name '.snapshot' -printf '%P\n' | sort)"
+if ls "${MACHINES}"/* > /dev/null 2>&1
+then
+ CONTAINERS="$(cd "${MACHINES}" 2>/dev/null && find -maxdepth 1 -type d -and -not -name '.container-tools' -and -not -name 'container-tools' -and -not -name 'lost+found' -and -not -name '.snap' -and -not -name '.snapshot' -printf '%P\n' | sort)"
+fi
for CONTAINER in ${CONTAINERS}
do