mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #6527/cb1e6376 backport][stable-7] nmcli: Fix bond option xmit_hash_policy (#6556)
nmcli: Fix bond option xmit_hash_policy (#6527)
* nmcli_bond_xmit_fix
* Create 6527-nmcli-bond-fix-xmit_hash_policy.yml
add changelog
* Update changelogs/fragments/6527-nmcli-bond-fix-xmit_hash_policy.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* unit tests extend
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit cb1e6376db
)
Co-authored-by: Sergey Putko <mail@psvlan.com>
This commit is contained in:
parent
813030a5f2
commit
443d5a2a5f
3 changed files with 9 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- nmcli - fix bond option ``xmit_hash_policy`` (https://github.com/ansible-collections/community.general/pull/6527).
|
|
@ -2119,6 +2119,9 @@ class Nmcli(object):
|
||||||
if key in self.SECRET_OPTIONS:
|
if key in self.SECRET_OPTIONS:
|
||||||
self.edit_commands += ['set %s %s' % (key, value)]
|
self.edit_commands += ['set %s %s' % (key, value)]
|
||||||
continue
|
continue
|
||||||
|
if key == 'xmit_hash_policy':
|
||||||
|
cmd.extend(['+bond.options', 'xmit_hash_policy=%s' % value])
|
||||||
|
continue
|
||||||
cmd.extend([key, value])
|
cmd.extend([key, value])
|
||||||
|
|
||||||
return self.execute_command(cmd)
|
return self.execute_command(cmd)
|
||||||
|
|
|
@ -500,6 +500,7 @@ TESTCASE_BOND = [
|
||||||
'conn_name': 'non_existent_nw_device',
|
'conn_name': 'non_existent_nw_device',
|
||||||
'ifname': 'bond_non_existant',
|
'ifname': 'bond_non_existant',
|
||||||
'mode': 'active-backup',
|
'mode': 'active-backup',
|
||||||
|
'xmit_hash_policy': 'layer3+4',
|
||||||
'ip4': '10.10.10.10/24',
|
'ip4': '10.10.10.10/24',
|
||||||
'gw4': '10.10.10.1',
|
'gw4': '10.10.10.1',
|
||||||
'state': 'present',
|
'state': 'present',
|
||||||
|
@ -522,7 +523,7 @@ ipv4.may-fail: yes
|
||||||
ipv6.method: auto
|
ipv6.method: auto
|
||||||
ipv6.ignore-auto-dns: no
|
ipv6.ignore-auto-dns: no
|
||||||
ipv6.ignore-auto-routes: no
|
ipv6.ignore-auto-routes: no
|
||||||
bond.options: mode=active-backup,primary=non_existent_primary
|
bond.options: mode=active-backup,primary=non_existent_primary,xmit_hash_policy=layer3+4
|
||||||
"""
|
"""
|
||||||
|
|
||||||
TESTCASE_BRIDGE = [
|
TESTCASE_BRIDGE = [
|
||||||
|
@ -1897,7 +1898,8 @@ def test_bond_connection_create(mocked_generic_connection_create, capfd):
|
||||||
|
|
||||||
for param in ['ipv4.gateway', 'primary', 'connection.autoconnect',
|
for param in ['ipv4.gateway', 'primary', 'connection.autoconnect',
|
||||||
'connection.interface-name', 'bond_non_existant',
|
'connection.interface-name', 'bond_non_existant',
|
||||||
'mode', 'active-backup', 'ipv4.addresses']:
|
'mode', 'active-backup', 'ipv4.addresses',
|
||||||
|
'+bond.options', 'xmit_hash_policy=layer3+4']:
|
||||||
assert param in args[0]
|
assert param in args[0]
|
||||||
|
|
||||||
out, err = capfd.readouterr()
|
out, err = capfd.readouterr()
|
||||||
|
|
Loading…
Reference in a new issue