[CI] Format code

This commit is contained in:
yunohost-bot 2021-08-08 17:30:19 +00:00
parent d4addb8e4c
commit 9f8c99a5b2
3 changed files with 11 additions and 5 deletions

View file

@ -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:

View file

@ -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"