mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
*: Use action_utils.run instead of subprocess.check_output
- This is to capture stdout and stderr and transmit that from privileged daemon back to the service to be displayed in HTML. Tests: - Unit tests and code checks pass. - Some of the modified actions work as expected. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
1 parent
bf9005ac48
commit
b253166f6d
17 files changed
+101
-72
No files matched your search
@@ -176,7 +176,8 @@ def get_config() -> FirewallConfig:
|
||||
config: FirewallConfig = {}
|
||||
|
||||
# Get the default zone.
|
||||
output = subprocess.check_output(['firewall-cmd', '--get-default-zone'])
|
||||
output = action_utils.run(['firewall-cmd', '--get-default-zone'],
|
||||
check=True).stdout
|
||||
config['default_zone'] = output.decode().strip()
|
||||
|
||||
# Load Augeas lens.
|
||||
@@ -191,8 +192,9 @@ def get_config() -> FirewallConfig:
|
||||
config['backend'] = aug.get('FirewallBackend')
|
||||
|
||||
# Get the list of direct passthroughs.
|
||||
output = subprocess.check_output(
|
||||
['firewall-cmd', '--direct', '--get-all-passthroughs'])
|
||||
output = action_utils.run(
|
||||
['firewall-cmd', '--direct', '--get-all-passthroughs'],
|
||||
check=True).stdout
|
||||
config['passthroughs'] = output.decode().strip().split('\n')
|
||||
|
||||
return config
|
||||
Reference in new issue
Block a user