Merge pull request #13563 from garethgreenaway/debian_ip_fixes

Fixes to debian_ip.py and friends.
This commit is contained in:
Thomas S Hatch 2014-06-19 14:23:14 -06:00
commit daba2db258
2 changed files with 15 additions and 9 deletions

View File

@ -1676,17 +1676,23 @@ def get_network_settings():
salt '*' ip.get_network_settings
'''
skip_etc_default_networking = (
__grains__['osfullname'] == 'Ubuntu' and
int(__grains__['osrelease'].split('.')[0]) >= 12)
settings = _parse_current_network_settings()
try:
template = JINJA.get_template('network.jinja')
except jinja2.exceptions.TemplateNotFound:
log.error('Could not load template network.jinja')
if skip_etc_default_networking:
return ''
else:
settings = _parse_current_network_settings()
network = template.render(settings)
return _read_temp(network)
try:
template = JINJA.get_template('network.jinja')
except jinja2.exceptions.TemplateNotFound:
log.error('Could not load template network.jinja')
return ''
network = template.render(settings)
return _read_temp(network)
def get_routes(iface):

View File

@ -30,7 +30,7 @@ iface {{name}} {{interface.addrfam}} {{interface.proto}}
{%endif%}{% if interface.provider %} provider {{interface.provider}}
{%endif%}{% if interface.unit %} unit {{interface.unit}}
{%endif%}{% if interface.options %} options {{interface.options}}
{%endif%}{% if interface.dns %} dns-nameservers {%for item in interface.dns %}{{item}} {%endfor%}
{%endif%}{% if interface.dns_nameservers %} dns-nameservers {%for item in interface.dns_nameservers %}{{item}} {%endfor%}
{%endif%}{% if interface.dns_search %} dns-search {% for item in interface.dns_search %}{{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 %} bond_{{item}} {{interface.bonding[item]}}