mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
zoph: Re-add a safety check when reading the setup state of the app
- Similar check was removed in 6646512a0adab6943503ec47372502fb28805911 when it was that it was not needed. Tests: - Run functional tests for zoph. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
9366597b77
commit
b5c641097a
@ -104,9 +104,13 @@ def set_configuration(enable_osm: bool | None = None,
|
||||
@privileged
|
||||
def is_configured() -> bool | None:
|
||||
"""Return whether zoph app is configured."""
|
||||
process = subprocess.run(['zoph', '--get-config', 'interface.user.remote'],
|
||||
stdout=subprocess.PIPE, check=True)
|
||||
return process.stdout.decode().strip() == 'true'
|
||||
try:
|
||||
process = subprocess.run(
|
||||
['zoph', '--get-config', 'interface.user.remote'],
|
||||
stdout=subprocess.PIPE, check=True)
|
||||
return process.stdout.decode().strip() == 'true'
|
||||
except (FileNotFoundError, subprocess.CalledProcessError):
|
||||
return None
|
||||
|
||||
|
||||
@privileged
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user