Merge pull request #1623 from dbungert/gh-udi-1723-netplan-apply

network: run `netplan apply` without snap env
This commit is contained in:
Dan Bungert 2023-03-30 07:02:58 -06:00 committed by GitHub
commit 92ac6544cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -46,6 +46,7 @@ from subiquitycore.ui.views.network import (
)
from subiquitycore.utils import (
arun_command,
orig_environ,
run_command,
)
@ -358,9 +359,13 @@ class BaseNetworkController(BaseController):
'systemd-networkd.service',
'systemd-networkd.socket'],
check=True)
env = orig_environ(None)
try:
await arun_command(['netplan', 'apply'], check=True)
except subprocess.CalledProcessError:
await arun_command(['netplan', 'apply'],
env=env, check=True)
except subprocess.CalledProcessError as cpe:
log.debug('CalledProcessError: '
f'stdout[{cpe.stdout}] stderr[{cpe.stderr}]')
error("apply")
raise
if devs_to_down or devs_to_delete: