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
|
@ -116,7 +116,7 @@ def domain_add(operation_logger, domain, dyndns=False):
|
||||||
domain = domain.lower()
|
domain = domain.lower()
|
||||||
|
|
||||||
# Non-latin characters (e.g. café.com => xn--caf-dma.com)
|
# 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
|
# DynDNS domain
|
||||||
if dyndns:
|
if dyndns:
|
||||||
|
|
|
@ -320,7 +320,13 @@ def hook_callback(
|
||||||
|
|
||||||
|
|
||||||
def hook_exec(
|
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
|
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
|
# Construct command to execute
|
||||||
if user == "root":
|
if user == "root":
|
||||||
command = ['sh', '-c']
|
command = ["sh", "-c"]
|
||||||
else:
|
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
|
# use xtrace on fd 7 which is redirected to stdout
|
||||||
env["BASH_XTRACEFD"] = "7"
|
env["BASH_XTRACEFD"] = "7"
|
||||||
|
|
Loading…
Add table
Reference in a new issue