mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[CI] Format code
This commit is contained in:
parent
d4addb8e4c
commit
9f8c99a5b2
3 changed files with 11 additions and 5 deletions
|
@ -520,7 +520,7 @@ def app_upgrade(app=[], url=None, file=None, force=False):
|
|||
apps = app
|
||||
# Check if disk space available
|
||||
if free_space_in_directory("/") <= 512 * 1000 * 1000:
|
||||
raise YunohostValidationError("disk_space_not_sufficient_update")
|
||||
raise YunohostValidationError("disk_space_not_sufficient_update")
|
||||
# If no app is specified, upgrade all apps
|
||||
if not apps:
|
||||
# FIXME : not sure what's supposed to happen if there is a url and a file but no apps...
|
||||
|
|
|
@ -116,7 +116,7 @@ def domain_add(operation_logger, domain, dyndns=False):
|
|||
domain = domain.lower()
|
||||
|
||||
# Non-latin characters (e.g. café.com => xn--caf-dma.com)
|
||||
domain = domain.encode('idna').decode('utf-8')
|
||||
domain = domain.encode("idna").decode("utf-8")
|
||||
|
||||
# DynDNS domain
|
||||
if dyndns:
|
||||
|
|
|
@ -320,7 +320,13 @@ def hook_callback(
|
|||
|
||||
|
||||
def hook_exec(
|
||||
path, args=None, raise_on_error=False, chdir=None, env=None, user="root", return_format="json"
|
||||
path,
|
||||
args=None,
|
||||
raise_on_error=False,
|
||||
chdir=None,
|
||||
env=None,
|
||||
user="root",
|
||||
return_format="json",
|
||||
):
|
||||
"""
|
||||
Execute hook from a file with arguments
|
||||
|
@ -419,9 +425,9 @@ def _hook_exec_bash(path, args, chdir, env, user, return_format, loggers):
|
|||
|
||||
# Construct command to execute
|
||||
if user == "root":
|
||||
command = ['sh', '-c']
|
||||
command = ["sh", "-c"]
|
||||
else:
|
||||
command = ['sudo', '-n', '-u', user, '-H', 'sh', '-c']
|
||||
command = ["sudo", "-n", "-u", user, "-H", "sh", "-c"]
|
||||
|
||||
# use xtrace on fd 7 which is redirected to stdout
|
||||
env["BASH_XTRACEFD"] = "7"
|
||||
|
|
Loading…
Add table
Reference in a new issue