network: run `netplan apply` without snap env
netplan isn't staged in the snap, and the environment variables being passed around don't help it.
This commit is contained in:
parent
bc33062e9b
commit
2bfff57f41
|
@ -46,6 +46,7 @@ from subiquitycore.ui.views.network import (
|
||||||
)
|
)
|
||||||
from subiquitycore.utils import (
|
from subiquitycore.utils import (
|
||||||
arun_command,
|
arun_command,
|
||||||
|
orig_environ,
|
||||||
run_command,
|
run_command,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -358,9 +359,13 @@ class BaseNetworkController(BaseController):
|
||||||
'systemd-networkd.service',
|
'systemd-networkd.service',
|
||||||
'systemd-networkd.socket'],
|
'systemd-networkd.socket'],
|
||||||
check=True)
|
check=True)
|
||||||
|
env = orig_environ(None)
|
||||||
try:
|
try:
|
||||||
await arun_command(['netplan', 'apply'], check=True)
|
await arun_command(['netplan', 'apply'],
|
||||||
except subprocess.CalledProcessError:
|
env=env, check=True)
|
||||||
|
except subprocess.CalledProcessError as cpe:
|
||||||
|
log.debug('CalledProcessError: '
|
||||||
|
f'stdout[{cpe.stdout}] stderr[{cpe.stderr}]')
|
||||||
error("apply")
|
error("apply")
|
||||||
raise
|
raise
|
||||||
if devs_to_down or devs_to_delete:
|
if devs_to_down or devs_to_delete:
|
||||||
|
|
Loading…
Reference in New Issue