config : fallback to port 22 instead of None

The configparser fallback option for port was None set it to use 22
instead as None doesn't make sense
This commit is contained in:
2026-01-01 17:30:28 +01:00
parent 27924013d9
commit 10200fceb9

View File

@@ -16,7 +16,7 @@ class ServerConfig:
sshargs: str = "" sshargs: str = ""
hostname: str = "" hostname: str = ""
ip: str = "" ip: str = ""
port: int | None = 22 port: int = 22
def __post_init__(self): def __post_init__(self):
""" """
@@ -85,7 +85,7 @@ def load_config(config_path:str) -> Config:
config.get(server_section, "sshargs", fallback=""), config.get(server_section, "sshargs", fallback=""),
config.get(server_section, "hostname", fallback=""), config.get(server_section, "hostname", fallback=""),
config.get(server_section, "ip", fallback=""), config.get(server_section, "ip", fallback=""),
config.getint(server_section, "port", fallback=None) config.getint(server_section, "port", fallback=22)
) )
roots_config = RootsConfig( roots_config = RootsConfig(
config.get(roots_section, "local"), config.get(roots_section, "local"),