fix enabling dhcp on a virtual interface

This commit is contained in:
Michael Hudson-Doyle 2020-03-20 09:01:30 +13:00
parent ac587f9bf6
commit cc52bb62a5
2 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,10 @@ Network:
subnet: "10.2.0.0/24"
address: 10.2.0.1
searchdomains: lab
- obj: [interface name bond10]
action: EDIT_IPV4
method-data:
method: dhcp
- action: done
Proxy:
proxy: ""

View File

@ -67,7 +67,8 @@ class SubiquityNetworkEventReceiver(NetworkEventReceiver):
netdev = self.model.update_link(ifindex)
if netdev is None:
return
if not (netdev.info.flags & IFF_UP) and ifindex in self.default_routes:
flags = getattr(netdev.info, "flags", 0)
if not (flags & IFF_UP) and ifindex in self.default_routes:
self.default_routes.remove(ifindex)
for watcher in self.default_route_watchers:
watcher(self.default_routes)