diff options
author | Heitor Alves de Siqueira <halves@canonical.com> | 2020-05-28 09:19:07 -0300 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2020-07-25 10:14:32 +0200 |
commit | adf4515eb563bcbb85b9915495adaf56e886490e (patch) | |
tree | 2012219ff1274fd8c668f272c699b77ce3aff2d0 | |
parent | 6e30eab9b57578e9da4c96eb873e1ac1d7c69823 (diff) |
Fix process_link_changes handling 'up' interfaces
b7f1d9b04212 refactored process_link_changes with helper methods to get
the interface driver name and MAC address. This new code introduced a
regression where it's possible for an interface in the up state to be
included in the changelist by its MAC address.
This patch restores the previous behaviour, skipping interfaces that
don't have driver_name set.
Fixes: https://bugs.launchpad.net/bugs/1875411
Origin: upstream, https://github.com/CanonicalLtd/netplan/commit/8f77deec17ce
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1875411
Gbp-Pq: Name 0002-Fix-process_link_changes-handling-up-interfaces.patch
-rw-r--r-- | netplan/cli/commands/apply.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/netplan/cli/commands/apply.py b/netplan/cli/commands/apply.py index cf9f122..4b91ae9 100644 --- a/netplan/cli/commands/apply.py +++ b/netplan/cli/commands/apply.py @@ -244,6 +244,9 @@ class NetplanApply(utils.NetplanCommand): continue driver_name = utils.get_interface_driver_name(interface, only_down=True) + if not driver_name: + # don't allow up interfaces to match by mac + continue macaddress = utils.get_interface_macaddress(interface) if driver_name in matches['by-driver']: new_name = matches['by-driver'][driver_name] |