diff options
author | Scott Moser <smoser@brickies.net> | 2019-07-18 01:27:36 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-07-18 01:27:36 +0000 |
commit | 5498107d184815fe2e591748e247ab98a4e6d681 (patch) | |
tree | 60619433e444de180d822c25f14b523469bcdf25 /cloudinit/net | |
parent | b3a87fc0a2c88585cf77fa9d2756e96183c838f7 (diff) | |
download | vyos-cloud-init-5498107d184815fe2e591748e247ab98a4e6d681.tar.gz vyos-cloud-init-5498107d184815fe2e591748e247ab98a4e6d681.zip |
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
Diffstat (limited to 'cloudinit/net')
-rw-r--r-- | cloudinit/net/network_state.py | 4 |
1 files changed, 4 insertions, 0 deletions
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}) |