Commit 2f111106 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Merge branch 'master' into debian

parents d229d112 0f9dd60c
2015-03-13, v0.18.1
* HELPER: Fix a bug in ConfigureNetwork task that caused a syntax error
if the SUBNET was missing for a NIC
2015-03-03, v0.18
* HELPER: Auto-detect OSFAMILY and ROOT_PARTITION properties if missing
* HELPER: Add new CofigureNetwork image configuration task
......
__version__ = "0.18"
__version__ = "0.18.1"
......@@ -72,7 +72,8 @@ grep -v "ifconfig_$driver$index" "$CONF" > "$tmp_config"
cat "$tmp_config" > "$CONF"
if [ "$ipv4" = 'static' ]; then
echo "ifconfig_$driver$index=\"inet $IP netmask $(cidr2mask "${SUBNET##*/}")\"" >> "$CONF"
netmask=$(cidr2mask "${SUBNET##*/}")
echo "ifconfig_$driver$index=\"inet $IP netmask $netmask\"" >> "$CONF"
if [ -n "$GATEWAY" ]; then
sed -i '/^defaultrouter=/d' "$CONF"
echo "defaultrouter=\"$GATEWAY\"" >> "$CONF"
......
......@@ -73,7 +73,8 @@ if [ "$ipv4" != none -o "$ipv6" != none ]; then
fi
if [ "$ipv4" = 'static' ]; then
echo "inet $IP netmask $(cidr2mask "${SUBNET##*/}")" >> "$IFCONFIG"
netmask=$(cidr2mask "${SUBNET##*/}")
echo "inet $IP netmask $netmask" >> "$IFCONFIG"
if [ -n "$GATEWAY" ]; then
sed -i '/^defaultroute=/d' "$RC_CONF"
echo "defaultroute=$GATEWAY" >> "$RC_CONF"
......
......@@ -69,7 +69,8 @@ SYSCTL="$SNF_IMAGE_TARGET/etc/sysctl.conf"
cat /dev/null > "$HOSTNAME"
if [ "$ipv4" = 'static' ]; then
echo "inet $IP $(cidr2mask "${SUBNET##*/}") NONE" >> "$HOSTNAME"
netmask=$(cidr2mask "${SUBNET##*/}")
echo "inet $IP $netmask NONE" >> "$HOSTNAME"
if [ -n "$GATEWAY" ]; then
echo "$GATEWAY" > "$MYGATE"
fi
......
......@@ -70,7 +70,8 @@ echo -e "DEVICE=eth${index}\nONBOOT=yes\nHWADDR=$MAC" > "$IFCFG"
echo "NM_CONTROLLED=yes" >> "$IFCFG"
if [ "$ipv4" = 'static' ]; then
echo -e "BOOTPROTO=static\nIPADDR=$IP\nNETMASK=$(cidr2mask "${SUBNET##*/}")" >> "$IFCFG"
netmask=$(cidr2mask "${SUBNET##*/}")
echo -e "BOOTPROTO=static\nIPADDR=$IP\nNETMASK=$netmask" >> "$IFCFG"
elif [ "$ipv4" = 'dhcp' ]; then
echo -e "BOOTPROTO=dhcp" >> "$IFCFG"
else
......
......@@ -92,6 +92,11 @@ for index in $(seq 0 $((NIC_COUNT-1))); do
done
done
# If the subnet is missing, the card cannot be configure in a static way
if [ -z "${SUBNET}" ]; then
dhcp=yes
fi
if [ -n "${IP}" ]; then
ipv4=yes
fi
......
m4_define([devflow_version], [0.18])
m4_define([devflow_version], [0.18.1])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment