1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

some fixes + template support

Ticket: CM-1438
Reviewed By:
Testing Done:

This patch adds support for mako style templates.

Example:
% for v in [20,30,40]:
auto vlan${v}
    iface vlan${v} inet static
    address 10.20.${v}.3/24
    mstpctl_ports  glob swp1-52.${v}
    mstpctl_stp on
% endfor

open items:
    - currently templates will only work if python-mako is installed
      (Its apt-gettable from debian wheezy).
This commit is contained in:
roopa
2013-12-20 13:59:37 -08:00
parent 551a3627d4
commit 579b3f255d
3 changed files with 55 additions and 35 deletions

View File

@@ -22,6 +22,8 @@ CONFIGURE_INTERFACES=yes
EXCLUDE_INTERFACES=
VERBOSE=no
verbose=
[ -f /etc/default/networking ] && . /etc/default/networking
[ "$VERBOSE" = yes ] && verbose=-v
@@ -128,7 +130,7 @@ start)
set -f
exclusions=$(process_exclusions)
log_action_begin_msg "Configuring network interfaces"
if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose
if ifup -a $verbose --perfmode
then
log_action_end_msg $?
else
@@ -144,7 +146,7 @@ stop)
check_network_swap
log_action_begin_msg "Deconfiguring network interfaces"
if ifdown -a --exclude=lo $verbose; then
if ifdown -a --exclude=lo $verbose --perfmode --force; then
log_action_end_msg $?
else
log_action_end_msg $?
@@ -156,7 +158,7 @@ reload)
log_action_begin_msg "Reloading network interfaces configuration"
state=$(cat /run/network/ifstate)
ifdown -a --exclude=lo $verbose || true
ifdown -a --exclude=lo $verbose --perfmode --force || true
if ifup --exclude=lo $state $verbose ; then
log_action_end_msg $?
else
@@ -172,10 +174,10 @@ force-reload|restart)
#log_warning_msg "Running $0 $1 is deprecated because it may not re-enable some interfaces"
log_action_begin_msg "Reconfiguring network interfaces"
ifdown -a --exclude=lo $verbose || true
ifdown -a --exclude=lo $verbose --perfmode --force || true
set -f
exclusions=$(process_exclusions)
if ifup -a --exclude=lo $exclusions $verbose && ifup_hotplug $exclusions $verbose
if ifup -a --exclude=lo $verbose --perfmode
then
log_action_end_msg $?
else