fixing bond and bridge config templating in debian_ip module

This commit is contained in:
Arnold Bechtoldt 2014-02-15 23:10:51 +01:00
parent da6f73fbb2
commit 05bebb5f3c
2 changed files with 3 additions and 3 deletions

View File

@ -1261,7 +1261,7 @@ def build_interface(iface, iface_type, enabled, **settings):
if iface_type in ['eth', 'bond', 'bridge', 'slave', 'vlan']:
opts = _parse_settings_eth(settings, iface_type, enabled, iface)
if settings['test']:
if 'test' in settings and settings['test']:
return _read_temp_ifaces(iface, opts[iface])
ifcfg = _write_file_ifaces(iface, opts[iface])

View File

@ -12,8 +12,8 @@ iface {{name}} {{interface.inet_type}} {{interface.proto}}
{%endif%}{% if interface.mtu %} mtu {{interface.mtu}}
{%endif%}{% if interface.dns %} dns-nameservers {%for item in interface.dns %}{{item}} {%endfor%}
{%endif%}{% if interface.ethtool %}{%for item in interface.ethtool_keys %} {{item}} {{interface.ethtool[item]}}
{%endfor%}{%endif%}{% if interface.bonding %}{%for item in interface.bonding_keys %} {{item}} {{interface.bonding[item]}}
{%endfor%}{%endif%}{% if interface.bridgeing %}{%for item in interface.bridgeing_keys %} {{item}} {{interface.bridgeing[item]}}
{%endfor%}{%endif%}{% if interface.bonding %}{%for item in interface.bonding_keys %} bond_{{item}} {{interface.bonding[item]}}
{%endfor%}{%endif%}{% if interface.bridgeing %}{%for item in interface.bridgeing_keys %} bridge_{{item}} {{interface.bridgeing[item]}}
{%endfor%}{%endif%}{% if interface.up_cmds %}{% for cmd in interface.up_cmds %} up {{ cmd }}
{%endfor-%}
{%endif%}{% if interface.down_cmds %}{% for cmd in interface.down_cmds %} down {{ cmd }}