diff options
author | Scott Moser <smoser@ubuntu.com> | 2018-08-06 19:33:54 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2018-08-06 19:33:54 +0000 |
commit | 41f508da4f1e421f454136f3c84527a9911c63ff (patch) | |
tree | 2f0c8d93881ea3fd0b81ec0b5bb6aa7cefce9905 /cloudinit/net/netplan.py | |
parent | a6f95c72259f2890e4a9f9f11166310812173c68 (diff) | |
download | vyos-cloud-init-41f508da4f1e421f454136f3c84527a9911c63ff.tar.gz vyos-cloud-init-41f508da4f1e421f454136f3c84527a9911c63ff.zip |
netplan: Correctly render macaddress on a bonds and bridges when provided.
When converting network config v1 to netplan, we were not correctly
rendering the 'macaddress' key on a bond. Not that the difference
in spelling between v1 'mac_address' and v2 'macaddress' is intentional.
Also fixed here is rendering of the macaddress for bridges.
LP: #1784699
Diffstat (limited to 'cloudinit/net/netplan.py')
-rw-r--r-- | cloudinit/net/netplan.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py index 40143634..6352e78c 100644 --- a/cloudinit/net/netplan.py +++ b/cloudinit/net/netplan.py @@ -291,6 +291,8 @@ class Renderer(renderer.Renderer): if len(bond_config) > 0: bond.update({'parameters': bond_config}) + if ifcfg.get('mac_address'): + bond['macaddress'] = ifcfg.get('mac_address').lower() slave_interfaces = ifcfg.get('bond-slaves') if slave_interfaces == 'none': _extract_bond_slaves_by_name(interfaces, bond, ifname) @@ -327,6 +329,8 @@ class Renderer(renderer.Renderer): if len(br_config) > 0: bridge.update({'parameters': br_config}) + if ifcfg.get('mac_address'): + bridge['macaddress'] = ifcfg.get('mac_address').lower() _extract_addresses(ifcfg, bridge, ifname) bridges.update({ifname: bridge}) |