Commit dd048d3
committed
util/agents/network_interface: bail out if NM did not find an interface
nm.get_device_by_iface() returns None if there is no device for an
interface. This can happen if NetworkManager is not running, it it's in
an undefined state or if it does not manage the interface at all.
Instead of trying to call methods on the returned None type, let's bail
out early with a proper exception.
Signed-off-by: Bastian Krause <bst@pengutronix.de>1 parent 01628dc commit dd048d3
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
0 commit comments