do not always stop networkd

This commit is contained in:
Michael Hudson-Doyle 2019-12-12 09:41:02 +13:00
parent b155d3eff0
commit 4e1afd60a4
1 changed files with 11 additions and 8 deletions

View File

@ -386,6 +386,7 @@ class NetworkController(BaseController):
await arun_command(
['netplan', 'generate', '--root', self.root], check=True)
else:
if devs_to_down or devs_to_delete:
try:
await arun_command(
['systemctl', 'stop', 'systemd-networkd.service'],
@ -393,7 +394,9 @@ class NetworkController(BaseController):
except subprocess.CalledProcessError:
error("stop-networkd")
raise
if devs_to_down:
await self._down_devs(devs_to_down)
if devs_to_delete:
await self._delete_devs(devs_to_delete)
try:
await arun_command(['netplan', 'apply'], check=True)