summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-11-12 00:57:30 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-11-12 07:47:20 +0000
commitfefdd2a5a081c3e04a142a126d903afb13f0c996 (patch)
tree99ed91862887c4a5d5c707e34ff6cf02e7a329ab /lib
parentAvoid repeating ipv4 address of the previous container in container list comm... (diff)
downloadcompute-tools-fefdd2a5a081c3e04a142a126d903afb13f0c996.tar.xz
compute-tools-fefdd2a5a081c3e04a142a126d903afb13f0c996.zip
Using fallback to ifupdown addresses in container list command for container not using networkd yet.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlib/container/list3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/container/list b/lib/container/list
index f0c49ee..04e9f0f 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -188,6 +188,9 @@ do
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)"
+ elif [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
+ then
+ ADDRESSES="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces)"
fi
ADDRESSES="${ADDRESSES:-n/a}"