feat: add deprecated decorator

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-05-02 21:51:35 +02:00
parent 4a5d1a971a
commit 067a102b6b
2 changed files with 24 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ from utils import (
NGINX_CONFD,
NGINX_SITES_ENABLED,
)
from utils.decorators import deprecated
from utils.logger import Logger
@@ -59,6 +60,7 @@ def create_symlink(source: Path, target: Path, sudo=False) -> None:
raise
@deprecated(info="Use remove_with_sudo instead", replaced_by=remove_with_sudo)
def remove_file(file_path: Path, sudo=False) -> None:
try:
cmd = f"{'sudo ' if sudo else ''}rm -f {file_path}"