From 910ed46124e992eb20e49ea156b7127cd3ebbe9d Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Sat, 13 May 2017 01:45:23 +0100 Subject: nplan: For bonds, allow dashed or underscore names of keys. As some of the bond paramemters are passed in as dashed, or underscored, depending on the input source. Also correct transmit-hash-policy netplan target key. LP: #1690480 --- cloudinit/net/netplan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit/net') diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py index 9b71de97..d7ddf0c3 100644 --- a/cloudinit/net/netplan.py +++ b/cloudinit/net/netplan.py @@ -41,7 +41,7 @@ NET_CONFIG_TO_V2 = { 'bond-num-grat-arp': 'gratuitious-arp', 'bond-primary-reselect': 'primary-reselect-policy', 'bond-updelay': 'up-delay', - 'bond-xmit_hash_policy': 'transmit_hash_policy'}, + 'bond-xmit-hash-policy': 'transmit-hash-policy'}, 'bridge': {'bridge_ageing': 'ageing-time', 'bridge_bridgeprio': 'priority', 'bridge_fd': 'forward-delay', @@ -294,7 +294,7 @@ class Renderer(renderer.Renderer): for match in ['bond_', 'bond-']: bond_params = _get_params_dict_by_match(ifcfg, match) for (param, value) in bond_params.items(): - newname = v2_bond_map.get(param) + newname = v2_bond_map.get(param.replace('_', '-')) if newname is None: continue bond_config.update({newname: value}) -- cgit v1.2.3