mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[CI] Format code with Black
This commit is contained in:
parent
2f38639a2e
commit
94bf107838
4 changed files with 8 additions and 10 deletions
|
@ -42,7 +42,9 @@ class BaseSystemDiagnoser(Diagnoser):
|
||||||
elif os.path.exists("/sys/devices/virtual/dmi/id/sys_vendor"):
|
elif os.path.exists("/sys/devices/virtual/dmi/id/sys_vendor"):
|
||||||
model = read_file("/sys/devices/virtual/dmi/id/sys_vendor").strip()
|
model = read_file("/sys/devices/virtual/dmi/id/sys_vendor").strip()
|
||||||
if os.path.exists("/sys/devices/virtual/dmi/id/product_name"):
|
if os.path.exists("/sys/devices/virtual/dmi/id/product_name"):
|
||||||
product_name = read_file("/sys/devices/virtual/dmi/id/product_name").strip()
|
product_name = read_file(
|
||||||
|
"/sys/devices/virtual/dmi/id/product_name"
|
||||||
|
).strip()
|
||||||
model = f"{model} {product_name}"
|
model = f"{model} {product_name}"
|
||||||
hardware["data"]["model"] = model
|
hardware["data"]["model"] = model
|
||||||
hardware["details"] = ["diagnosis_basesystem_hardware_model"]
|
hardware["details"] = ["diagnosis_basesystem_hardware_model"]
|
||||||
|
|
|
@ -262,9 +262,7 @@ def dyndns_update(
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
raise YunohostError(
|
raise YunohostError(f"Failed to resolve {rdtype} for {domain}", raw_msg=True)
|
||||||
f"Failed to resolve {rdtype} for {domain}", raw_msg=True
|
|
||||||
)
|
|
||||||
|
|
||||||
old_ipv4 = resolve_domain(domain, "A")
|
old_ipv4 = resolve_domain(domain, "A")
|
||||||
old_ipv6 = resolve_domain(domain, "AAAA")
|
old_ipv6 = resolve_domain(domain, "AAAA")
|
||||||
|
|
|
@ -666,9 +666,9 @@ def permission_sync_to_user():
|
||||||
|
|
||||||
# These are the users that should be allowed because they are member of a group that is allowed for this permission ...
|
# These are the users that should be allowed because they are member of a group that is allowed for this permission ...
|
||||||
should_be_allowed_users = {
|
should_be_allowed_users = {
|
||||||
user
|
user
|
||||||
for group in permission_infos["allowed"]
|
for group in permission_infos["allowed"]
|
||||||
for user in groups[group]["members"]
|
for user in groups[group]["members"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Note that a LDAP operation with the same value that is in LDAP crash SLAP.
|
# Note that a LDAP operation with the same value that is in LDAP crash SLAP.
|
||||||
|
|
|
@ -1013,9 +1013,7 @@ def test_permission_app_install():
|
||||||
assert res["permissions_app.dev"]["url"] == "/dev"
|
assert res["permissions_app.dev"]["url"] == "/dev"
|
||||||
|
|
||||||
assert res["permissions_app.main"]["allowed"] == ["all_users"]
|
assert res["permissions_app.main"]["allowed"] == ["all_users"]
|
||||||
assert set(res["permissions_app.main"]["corresponding_users"]) == {
|
assert set(res["permissions_app.main"]["corresponding_users"]) == {"alice", "bob"}
|
||||||
"alice", "bob"
|
|
||||||
}
|
|
||||||
|
|
||||||
assert res["permissions_app.admin"]["allowed"] == ["alice"]
|
assert res["permissions_app.admin"]["allowed"] == ["alice"]
|
||||||
assert res["permissions_app.admin"]["corresponding_users"] == ["alice"]
|
assert res["permissions_app.admin"]["corresponding_users"] == ["alice"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue