diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-07-25 13:37:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-07-26 03:46:53 +0000 |
commit | 64ea86f11c7a1398ee7b8f2a7764eded49f8ad0c (patch) | |
tree | c7640b0af15b05777e4cd2e8e1c3bd40dc6be7ff | |
parent | Adding sensible default lookups for container key bash-completion. (diff) | |
download | compute-tools-64ea86f11c7a1398ee7b8f2a7764eded49f8ad0c.tar.xz compute-tools-64ea86f11c7a1398ee7b8f2a7764eded49f8ad0c.zip |
Speeding up container list command by not gathering IP addresses for output format that don't need it.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | libexec/container/list | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libexec/container/list b/libexec/container/list index 3ef6e49..17a1958 100755 --- a/libexec/container/list +++ b/libexec/container/list @@ -368,7 +368,15 @@ do case "${STATE}" in started) - ADDRESS="$(cnt run -n ${CONTAINER} -- hostname -I | sed -e 's|\r$||' | awk '{ print $1 }')" + case "${FORMAT}" in + shell|sh) + ;; + + *) + ADDRESS="$(cnt run -n ${CONTAINER} -- hostname -I | sed -e 's|\r$||' | awk '{ print $1 }')" + ;; + esac + ADDRESS="${ADDRESS:-none}" ;; |