mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fix bonding filter
This commit is contained in:
parent
bb4f0f3e95
commit
97ecaab1b5
@ -152,15 +152,6 @@ def _parse_settings_bond(opts, iface):
|
||||
expecting.
|
||||
'''
|
||||
|
||||
# Check to make sure this is a bond interface
|
||||
if not opts['type'] == 'bond':
|
||||
return False
|
||||
|
||||
# Bonding settings
|
||||
if 'mode' not in opts:
|
||||
#TODO raise an error
|
||||
return
|
||||
|
||||
bond_def = {
|
||||
# Link monitoring in milliseconds. Most NICs support this
|
||||
'miimon': '100',
|
||||
@ -486,7 +477,7 @@ def _parse_settings_bond_6(opts, iface, bond_def):
|
||||
return bond
|
||||
|
||||
|
||||
def _parse_settings_eth(opts, iface):
|
||||
def _parse_settings_eth(opts, type, iface):
|
||||
'''
|
||||
Fiters given options and outputs valid settings for a
|
||||
network interface.
|
||||
@ -507,9 +498,10 @@ def _parse_settings_eth(opts, iface):
|
||||
if ethtool:
|
||||
result['ethtool'] = ethtool
|
||||
|
||||
bonding = _parse_settings_bond(opts, iface)
|
||||
if bonding:
|
||||
result['bonding'] = bonding
|
||||
if type == 'bond':
|
||||
bonding = _parse_settings_bond(opts, iface)
|
||||
if bonding:
|
||||
result['bonding'] = bonding
|
||||
|
||||
if 'addr' in opts:
|
||||
if _MAC_REGEX.match(opts['addr']):
|
||||
@ -674,7 +666,7 @@ def build_interface(iface, type, settings):
|
||||
settings['vlan'] = 'yes'
|
||||
|
||||
if type in ['eth', 'bond', 'slave', 'vlan']:
|
||||
opts = _parse_settings_eth(settings, iface)
|
||||
opts = _parse_settings_eth(settings, type, iface)
|
||||
template = env.get_template('eth.jinja')
|
||||
ifcfg = template.render(opts)
|
||||
|
||||
|
@ -16,6 +16,5 @@ DNS{{loop.index}}={{server}}
|
||||
{% endfor -%}
|
||||
{% if peerdns %}PEERDNS={{peerdns}}
|
||||
{%endif%}{%if bonding %}BONDING_OPTS={%for item in bonding %}{{item}}={{bonding[item]}} {%endfor%}
|
||||
{%endif%}
|
||||
{% if ethtool %}ETHTOOL_OPTS={%for item in ethtool %}{{item}} {{ethtool[item]}} {%endfor%}
|
||||
{%endif%}{% if ethtool %}ETHTOOL_OPTS={%for item in ethtool %}{{item}} {{ethtool[item]}} {%endfor%}
|
||||
{%endif%}
|
||||
|
Loading…
Reference in New Issue
Block a user