add SIM lint

This commit is contained in:
Jörg Thalheim
2024-09-02 16:29:50 +02:00
parent 38406bbe53
commit 357b619068
25 changed files with 59 additions and 85 deletions

View File

@@ -15,10 +15,7 @@ def send_join_request(host: str, port: int, cert: str) -> bool:
response = send_join_request_api(host, port)
if response:
return response
if send_join_request_native(host, port, cert):
return True
return False
return bool(send_join_request_native(host, port, cert))
# This is the preferred join method, but sunshines pin mechanism

View File

@@ -1,3 +1,4 @@
import contextlib
import os
import random
import string
@@ -72,10 +73,8 @@ def write_state(data: ConfigParser) -> bool:
def add_sunshine_host_to_parser(
config: ConfigParser, hostname: str, manual_host: str, certificate: str, uuid: str
) -> bool:
try:
with contextlib.suppress(DuplicateSectionError):
config.add_section("hosts")
except DuplicateSectionError:
pass
# amount of hosts
try: