add new methode of get_username() as fallback and add own file_parser for replace con_to_dict

This commit is contained in:
2025-05-09 16:04:43 +02:00
parent ca26576eab
commit 481362b2e6
5 changed files with 86 additions and 50 deletions

View File

@ -6,13 +6,18 @@ import shutil
from pathlib import Path
from subprocess import check_call
from wp_app_config import AppConfig
from common_tools import ConfigManager
import getpass
log_name: str = getpass.getuser()
if log_name == "root":
from common_tools import LxTools
log_name: str = LxTools.get_username()
print("replacement method applied")
log_name: str = ConfigManager.username()
keyfile: Path = Path(f"/home/{log_name}/.config/wire_py/pbwgk.pem")
# PKEYFILE: Path = "/usr/local/etc/ssl/pwgk.pem"
if not keyfile.is_file():
check_call(