diff --git a/cloudinit/net/network_manager.py b/cloudinit/net/network_manager.py index b643d40d858..30a56ebffdd 100644 --- a/cloudinit/net/network_manager.py +++ b/cloudinit/net/network_manager.py @@ -333,16 +333,18 @@ def render_interface(self, iface, network_state, renderer): # These are the interface properties that map nicely # to NetworkManager properties + # NOTE: Please ensure these items are formatted so as + # to match the schema in schema-network-config-v1.json _prop_map = { "bond": { "mode": "bond-mode", - "miimon": "bond_miimon", - "xmit_hash_policy": "bond-xmit-hash-policy", - "num_grat_arp": "bond-num-grat-arp", + "miimon": "bond-miimon", + "xmit_hash_policy": "bond-xmit_hash_policy", + "num_grat_arp": "bond-num_grat_arp", "downdelay": "bond-downdelay", "updelay": "bond-updelay", - "fail_over_mac": "bond-fail-over-mac", - "primary_reselect": "bond-primary-reselect", + "fail_over_mac": "bond-fail_over_mac", + "primary_reselect": "bond-primary_reselect", "primary": "bond-primary", }, "bridge": { diff --git a/tests/unittests/net/network_configs.py b/tests/unittests/net/network_configs.py index 2b55bbf421a..0779c5809a9 100644 --- a/tests/unittests/net/network_configs.py +++ b/tests/unittests/net/network_configs.py @@ -2160,8 +2160,6 @@ [bond] mode=active-backup - miimon=100 - xmit_hash_policy=layer3+4 [ipv6] method=auto @@ -3055,13 +3053,13 @@ params: bond-mode: active-backup bond_miimon: 100 - bond-xmit-hash-policy: "layer3+4" - bond-num-grat-arp: 5 + bond-xmit_hash_policy: "layer3+4" + bond-num_grat_arp: 5 bond-downdelay: 10 bond-updelay: 20 - bond-fail-over-mac: active + bond-fail_over_mac: active bond-primary: bond0s0 - bond-primary-reselect: always + bond-primary_reselect: always subnets: - type: static address: 192.168.0.2/24 @@ -3138,27 +3136,27 @@ auto bond0s0 iface bond0s0 inet manual bond-downdelay 10 - bond-fail-over-mac active + bond-fail_over_mac active bond-master bond0 bond-mode active-backup - bond-num-grat-arp 5 + bond-num_grat_arp 5 bond-primary bond0s0 - bond-primary-reselect always + bond-primary_reselect always bond-updelay 20 - bond-xmit-hash-policy layer3+4 + bond-xmit_hash_policy layer3+4 bond_miimon 100 auto bond0s1 iface bond0s1 inet manual bond-downdelay 10 - bond-fail-over-mac active + bond-fail_over_mac active bond-master bond0 bond-mode active-backup - bond-num-grat-arp 5 + bond-num_grat_arp 5 bond-primary bond0s0 - bond-primary-reselect always + bond-primary_reselect always bond-updelay 20 - bond-xmit-hash-policy layer3+4 + bond-xmit_hash_policy layer3+4 bond_miimon 100 auto bond0 @@ -3166,14 +3164,14 @@ address 192.168.0.2/24 gateway 192.168.0.1 bond-downdelay 10 - bond-fail-over-mac active + bond-fail_over_mac active bond-mode active-backup - bond-num-grat-arp 5 + bond-num_grat_arp 5 bond-primary bond0s0 - bond-primary-reselect always + bond-primary_reselect always bond-slaves none bond-updelay 20 - bond-xmit-hash-policy layer3+4 + bond-xmit_hash_policy layer3+4 bond_miimon 100 hwaddress aa:bb:cc:dd:e8:ff mtu 9000 @@ -3199,12 +3197,8 @@ "ifcfg-bond0": textwrap.dedent( """\ BONDING_MASTER=yes - BONDING_MODULE_OPTS="mode=active-backup xmit_hash_policy=layer3+4 """ - """miimon=100 num_grat_arp=5 """ - """downdelay=10 updelay=20 """ - """fail_over_mac=active """ - """primary=bond0s0 """ - """primary_reselect=always" + BONDING_MODULE_OPTS="mode=active-backup miimon=100 """ + """downdelay=10 updelay=20 primary=bond0s0" BONDING_SLAVE_0=bond0s0 BONDING_SLAVE_1=bond0s1 BOOTPROTO=static @@ -3237,12 +3231,8 @@ "ifcfg-bond0": textwrap.dedent( """\ BONDING_MASTER=yes - BONDING_OPTS="mode=active-backup xmit_hash_policy=layer3+4 """ - """miimon=100 num_grat_arp=5 """ - """downdelay=10 updelay=20 """ - """fail_over_mac=active """ - """primary=bond0s0 """ - """primary_reselect=always" + BONDING_OPTS="mode=active-backup miimon=100 """ + """downdelay=10 updelay=20 primary=bond0s0" BONDING_SLAVE0=bond0s0 BONDING_SLAVE1=bond0s1 BOOTPROTO=none @@ -3361,7 +3351,6 @@ [bond] mode=active-backup - miimon=100 xmit_hash_policy=layer3+4 num_grat_arp=5 downdelay=10 @@ -3719,8 +3708,6 @@ [bond] mode=active-backup - miimon=100 - xmit_hash_policy=layer3+4 num_grat_arp=5 downdelay=10 updelay=20 diff --git a/tests/unittests/net/test_network_manager.py b/tests/unittests/net/test_network_manager.py index d9afb78d936..4551698daba 100644 --- a/tests/unittests/net/test_network_manager.py +++ b/tests/unittests/net/test_network_manager.py @@ -129,6 +129,8 @@ def test_bond_dns_baseline(self, tmpdir): [bond] mode=802.3ad + miimon=100 + xmit_hash_policy=layer3+4 [ipv4] method=disabled @@ -286,6 +288,8 @@ def test_bond_dns_redacted_with_method_disabled(self, tmpdir): [bond] mode=802.3ad + miimon=100 + xmit_hash_policy=layer3+4 [ipv4] method=disabled diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py index 08bf5aa64de..68e44fa8021 100644 --- a/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py @@ -200,7 +200,7 @@ bond-miimon: 100 bond-mode: 802.3ad bond-updelay: 0 - bond-xmit-hash-policy: layer3+4 + bond-xmit_hash_policy: layer3+4 subnets: - address: 10.101.10.47/23 gateway: 10.101.11.254 @@ -254,7 +254,7 @@ bond-miimon: 100 bond-mode: 802.3ad bond-updelay: 0 - bond-xmit-hash-policy: layer3+4 + bond-xmit_hash_policy: layer3+4 subnets: - type: manual type: bond @@ -296,7 +296,7 @@ bond-miimon: 100 bond-mode: 802.3ad bond-updelay: 0 - bond-xmit-hash-policy: layer3+4 + bond-xmit_hash_policy: layer3+4 subnets: - address: 10.101.8.65/26 routes: