summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-11 10:59:18 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-11 12:12:59 +0000
commitf03844a09bd7c9dadaac448a7451917114c80a3e (patch)
treeb698438cacf5dfeba40a961e6fbb9f1706abdfdb
parentRenaming short format in container list command to shell for consistency. (diff)
downloadcompute-tools-f03844a09bd7c9dadaac448a7451917114c80a3e.tar.xz
compute-tools-f03844a09bd7c9dadaac448a7451917114c80a3e.zip
Removing half-finished multi-address handling in container list command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rwxr-xr-xlib/container/list26
1 files changed, 6 insertions, 20 deletions
diff --git a/lib/container/list b/lib/container/list
index 7e27a5f..453b46e 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -101,25 +101,11 @@ List ()
{
case "${FORMAT}" in
cli)
- FIRST_LINE="true"
-
- for ADDRESS in ${ADDRESSES}
- do
- case "${FIRST_LINE}" in
- true)
- FIRST_LINE="false"
- printf "%-80s %-29s\n" "${STATUS} ${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}"
- ;;
-
- *)
- printf "%-80s %-29s\n" "" "${ADDRESS}"
- ;;
- esac
- done
+ printf "%-80s %-29s\n" "${STATUS} ${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}"
;;
shell)
- printf "${CONTAINER}\n"
+ echo "${CONTAINER}"
;;
esac
}
@@ -180,17 +166,17 @@ do
;;
esac
- ADDRESSES=""
+ ADDRESS=""
if ls "${MACHINES}/${CONTAINER}/etc/systemd/network"/*.network > /dev/null 2>&1
then
- ADDRESSES="$(awk -F= '/Address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/systemd/network/*.network)"
+ ADDRESS="$(awk -F= '/Address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/systemd/network/*.network | head -n1)"
elif [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
then
- ADDRESSES="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces)"
+ ADDRESS="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces | head -n1)"
fi
- ADDRESSES="${ADDRESSES:-n/a}"
+ ADDRESS="${ADDRESS:-n/a}"
if echo ${LIST} | grep -qs all
then