mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update primary bonding option in rh_ip.py (#39069)
* Update rh_ip.py Add support for the "primary" bonding option in active-backup, balancd-tlb and balance-alb type bonds for RH. This is used to specify a preferred slave for the link. Remove support for the balance-xor bond type, since it is not supported by the kernel. Reference: https://www.kernel.org/doc/Documentation/networking/bonding.txt "The primary option is only valid for active-backup(1), balance-tlb (5) and balance-alb (6) mode." * Update rh_ip.py
This commit is contained in:
parent
a0861f0701
commit
cac0bec3f6
1 changed files with 9 additions and 3 deletions
|
@ -334,6 +334,9 @@ def _parse_settings_bond_1(opts, iface, bond_def):
|
|||
_log_default_iface(iface, 'use_carrier', bond_def['use_carrier'])
|
||||
bond.update({'use_carrier': bond_def['use_carrier']})
|
||||
|
||||
if 'primary' in opts:
|
||||
bond.update({'primary': opts['primary']})
|
||||
|
||||
return bond
|
||||
|
||||
|
||||
|
@ -374,9 +377,6 @@ def _parse_settings_bond_2(opts, iface, bond_def):
|
|||
_log_default_iface(iface, 'arp_interval', bond_def['arp_interval'])
|
||||
bond.update({'arp_interval': bond_def['arp_interval']})
|
||||
|
||||
if 'primary' in opts:
|
||||
bond.update({'primary': opts['primary']})
|
||||
|
||||
if 'hashing-algorithm' in opts:
|
||||
valid = ['layer2', 'layer2+3', 'layer3+4']
|
||||
if opts['hashing-algorithm'] in valid:
|
||||
|
@ -507,6 +507,9 @@ def _parse_settings_bond_5(opts, iface, bond_def):
|
|||
_log_default_iface(iface, 'use_carrier', bond_def['use_carrier'])
|
||||
bond.update({'use_carrier': bond_def['use_carrier']})
|
||||
|
||||
if 'primary' in opts:
|
||||
bond.update({'primary': opts['primary']})
|
||||
|
||||
return bond
|
||||
|
||||
|
||||
|
@ -543,6 +546,9 @@ def _parse_settings_bond_6(opts, iface, bond_def):
|
|||
_log_default_iface(iface, 'use_carrier', bond_def['use_carrier'])
|
||||
bond.update({'use_carrier': bond_def['use_carrier']})
|
||||
|
||||
if 'primary' in opts:
|
||||
bond.update({'primary': opts['primary']})
|
||||
|
||||
return bond
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue