mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +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
|
@privileged
|
||||||
def is_configured() -> bool | None:
|
def is_configured() -> bool | None:
|
||||||
"""Return whether zoph app is configured."""
|
"""Return whether zoph app is configured."""
|
||||||
process = subprocess.run(['zoph', '--get-config', 'interface.user.remote'],
|
try:
|
||||||
stdout=subprocess.PIPE, check=True)
|
process = subprocess.run(
|
||||||
return process.stdout.decode().strip() == 'true'
|
['zoph', '--get-config', 'interface.user.remote'],
|
||||||
|
stdout=subprocess.PIPE, check=True)
|
||||||
|
return process.stdout.decode().strip() == 'true'
|
||||||
|
except (FileNotFoundError, subprocess.CalledProcessError):
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
@privileged
|
@privileged
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user