diff --git a/salt/modules/rh_ip.py b/salt/modules/rh_ip.py index 6560ed878b..904ae58827 100644 --- a/salt/modules/rh_ip.py +++ b/salt/modules/rh_ip.py @@ -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) diff --git a/salt/modules/rh_ip/eth.jinja b/salt/modules/rh_ip/eth.jinja index b98009426d..f010a9f09e 100644 --- a/salt/modules/rh_ip/eth.jinja +++ b/salt/modules/rh_ip/eth.jinja @@ -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%}