From 5498107d184815fe2e591748e247ab98a4e6d681 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 18 Jul 2019 01:27:36 +0000 Subject: Fix bug rendering MTU on bond or vlan when input was netplan. If input to network_state.parse_net_config_data was netplan (v2 yaml) then the network state would lose the mtu information on bond or vlan. LP: #1836949 --- cloudinit/net/network_state.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cloudinit') diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py index 3702130a..0ca576b6 100644 --- a/cloudinit/net/network_state.py +++ b/cloudinit/net/network_state.py @@ -673,6 +673,8 @@ class NetworkStateInterpreter(object): 'vlan_id': cfg.get('id'), 'vlan_link': cfg.get('link'), } + if 'mtu' in cfg: + vlan_cmd['mtu'] = cfg['mtu'] subnets = self._v2_to_v1_ipcfg(cfg) if len(subnets) > 0: vlan_cmd.update({'subnets': subnets}) @@ -722,6 +724,8 @@ class NetworkStateInterpreter(object): 'params': dict((v2key_to_v1[k], v) for k, v in item_params.get('parameters', {}).items()) } + if 'mtu' in item_cfg: + v1_cmd['mtu'] = item_cfg['mtu'] subnets = self._v2_to_v1_ipcfg(item_cfg) if len(subnets) > 0: v1_cmd.update({'subnets': subnets}) -- cgit v1.2.3