in common_tools CryptUtils.decrypt() method

remove check file .dat is exist in path
This commit is contained in:
2025-06-08 00:50:21 +02:00
parent 32e375b2e4
commit ffb9a5ba5f
2 changed files with 22 additions and 19 deletions

View File

@ -21,31 +21,29 @@ class CryptoUtil:
"""
@staticmethod
def decrypt(user, path) -> None:
def decrypt(user) -> None:
"""
Starts SSL dencrypt
"""
if len([file.stem for file in path.glob("*.dat")]) == 0:
pass
process: CompletedProcess[str] = run(
["pkexec", "/usr/local/bin/ssl_decrypt.py", "--user", user],
capture_output=True,
text=True,
check=False,
)
# Output from Openssl Error
if process.stderr:
logging.error(process.stderr, exc_info=True)
if process.returncode == 0:
logging.info("Files successfully decrypted...", exc_info=True)
else:
process: CompletedProcess[str] = run(
["pkexec", "/usr/local/bin/ssl_decrypt.py", "--user", user],
capture_output=True,
text=True,
check=False,
logging.error(
f"Error process decrypt: Code {process.returncode}", exc_info=True
)
# Output from Openssl Error
if process.stderr:
logging.error(process.stderr, exc_info=True)
if process.returncode == 0:
logging.info("Files successfully decrypted...", exc_info=True)
else:
logging.error(
f"Error process decrypt: Code {process.returncode}", exc_info=True
)
@staticmethod
def encrypt(user) -> None:
"""