mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
refactored actions to use exceptions instead of return-values
This commit is contained in:
1 parent
a40d42eb60
commit
0d5636a900
12 files changed
+62
-72
No files matched your search
@@ -196,16 +196,10 @@ def _apply_changes(request, old_status, new_status):
|
||||
def _run(arguments, superuser=True):
|
||||
"""Run an given command and raise exception if there was an error"""
|
||||
command = 'pagekite-configure'
|
||||
|
||||
LOGGER.info('Running command - %s, %s, %s', command, arguments, superuser)
|
||||
|
||||
if superuser:
|
||||
output, error = actions.superuser_run(command, arguments)
|
||||
output = actions.superuser_run(command, arguments)
|
||||
else:
|
||||
output, error = actions.run(command, arguments)
|
||||
|
||||
if error:
|
||||
raise Exception('Error setting/getting PageKite confguration - %s'
|
||||
% error)
|
||||
|
||||
output = actions.run(command, arguments)
|
||||
return output
|
||||
Reference in new issue
Block a user