mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
container: Don't fail if there's no fbx network
Display debugging info if the reason for failure is different. Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com> [sunil: Indentation, fix pylint message] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
4b51396860
commit
0a2091a366
12
container
12
container
@ -812,8 +812,16 @@ def _destroy(distribution):
|
||||
|
||||
connection_name = f'fbx-{distribution}-shared'
|
||||
logger.info('Removing Network Manager connection %s', connection_name)
|
||||
subprocess.run(['sudo', 'nmcli', 'connection', 'delete', connection_name],
|
||||
stdout=subprocess.DEVNULL)
|
||||
result = subprocess.run(
|
||||
['sudo', 'nmcli', 'connection', 'delete', connection_name],
|
||||
capture_output=True)
|
||||
if result.returncode not in (0, 10):
|
||||
# nmcli failed and not due to 'Connection, device, or access point does
|
||||
# not exist.' See
|
||||
# https://developer-old.gnome.org/NetworkManager/stable/nmcli.html
|
||||
logger.error('nmcli returned code %d', result.returncode)
|
||||
logger.error('Error message:\n%s', result.stderr.decode())
|
||||
logger.error('Output:\n%s', result.stdout.decode())
|
||||
|
||||
logger.info('Keeping downloaded image: %s',
|
||||
_get_compressed_image_path(distribution))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user