diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-10-13 13:12:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-10-13 13:15:02 +0000 |
commit | c8e07171b9af74092235a45ccc1cd81b98c764fc (patch) | |
tree | b5f9ec4ece98546e628a4dfaa32f0f08fecbbe3b /lib/container | |
parent | Releasing debian version 20170726-1. (diff) | |
download | open-infrastructure-compute-tools-c8e07171b9af74092235a45ccc1cd81b98c764fc.tar.xz open-infrastructure-compute-tools-c8e07171b9af74092235a45ccc1cd81b98c764fc.zip |
Merging upstream version 20171013.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/container')
-rwxr-xr-x | lib/container/list | 2 | ||||
-rwxr-xr-x | lib/container/start | 23 | ||||
-rwxr-xr-x | lib/container/stop | 6 |
3 files changed, 13 insertions, 18 deletions
diff --git a/lib/container/list b/lib/container/list index cd88475..80e4e35 100755 --- a/lib/container/list +++ b/lib/container/list @@ -26,6 +26,8 @@ MACHINES="/var/lib/machines" VERSION="$(container version)" +TERM="${TERM:-linux}" + Parameters () { GETOPT_LONGOPTIONS="all,csv-separator:,format:,host:,nwdiag-color:,nwdiag-label:,other,started,stopped," diff --git a/lib/container/start b/lib/container/start index 6d2c7a9..566b4b0 100755 --- a/lib/container/start +++ b/lib/container/start @@ -295,15 +295,16 @@ then MACHINE="--machine=${NAME}" - NETWORK_VETH_EXTRA_CONF="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" NETWORK_VETH_EXTRA="" - case "${NETWORK_VETH_EXTRA_CONF}" in + VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" + + case "${VETHS}" in "") ;; *) - for VETH in ${NETWORK_VETH_EXTRA_CONF} + for VETH in ${VETHS} do NETWORK_VETH_EXTRA="${NETWORK_VETH_EXTRA} --network-veth-extra=${VETH}" INTERFACE="$(echo ${VETH} | awk -F: '{ print $1 }')" @@ -312,14 +313,6 @@ then then echo "'${INTERFACE}': name exceeds maximum of 15 characters, network might be not working." fi - -cat > "/etc/network/interfaces.d/${INTERFACE}" << EOF -allow-hotplug ${INTERFACE} -iface ${INTERFACE} inet manual - pre-up ifconfig ${INTERFACE} up - post-down ifconfig ${INTERFACE} down -EOF - done ;; esac @@ -347,10 +340,10 @@ EOF cat > "/etc/network/interfaces.d/${INTERFACE}" << EOF allow-hotplug ${INTERFACE} iface ${INTERFACE} inet manual - pre-up ifconfig ${INTERFACE} up - post-up brctl addif ${BRIDGE} ${INTERFACE} - pre-down brctl delif ${BRIDGE} ${INTERFACE} - post-down ifconfig ${INTERFACE} down + pre-up ip link set ${INTERFACE} up + post-up ip link set ${INTERFACE} master ${BRIDGE} + pre-down ip link set ${INTERFACE} nomaster + post-down ip link set ${INTERFACE} down EOF else diff --git a/lib/container/stop b/lib/container/stop index 12cf7fa..6b1c986 100755 --- a/lib/container/stop +++ b/lib/container/stop @@ -176,14 +176,14 @@ case "${CLEAN}" in fi # Removing network configuration - NETWORK_VETH_EXTRA_CONF="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" + VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" - case "${NETWORK_VETH_EXTRA_CONF}" in + case "${VETHS}" in "") ;; *) - for VETH in ${NETWORK_VETH_EXTRA_CONF} + for VETH in ${VETHS} do INTERFACE="$(echo ${VETH} | awk -F: '{ print $1 }')" FILE="/etc/network/interfaces.d/${INTERFACE}" |