On netplan apply
, tolerate devices that do not appear in /sys/class/net
#86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When using the NetworkManager renderer, the logic in
NetplanApply.command_apply()
tellsnmcli
to disconnect the devices previously populated bynetifaces.interfaces()
.In addition, if an alias like "eth0:0" exists, it will show as a device from
netifaces.interfaces()
but will not have a path in/sys/class/net
.This means that the
devices
variable may have more devices than actually exist due to the pastnmcli device disconnect
run or the presence of one or more aliases.This merge request fixes this bug by tolerating all errors from
udevadm test-builtin net_setup_link /sys/class/net/XXX
so thatnetplan apply
doesn't quit and leave the user without a network setup.Fixes Launchpad bug #1810043
Checklist
make check
successfully.make check-coverage
).