From e8d9f70403b105025f3271c2ad4843d31fbf11bb Mon Sep 17 00:00:00 2001 From: Umit Kablan Date: Thu, 3 Oct 2024 11:26:27 +0300 Subject: [PATCH] rm unnecessary lines --- pleskdistup/common/src/dpkg.py | 2 +- pleskdistup/common/src/util.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/pleskdistup/common/src/dpkg.py b/pleskdistup/common/src/dpkg.py index b78d210..45194d2 100644 --- a/pleskdistup/common/src/dpkg.py +++ b/pleskdistup/common/src/dpkg.py @@ -191,7 +191,6 @@ def restore_installation() -> None: def do_distupgrade(locked_sleep_intervals: typing.List[int] = []) -> None: - i = 0 cant_get_lock = False def process_stdout(line: str) -> None: @@ -205,6 +204,7 @@ def process_stderr(line: str) -> None: if "E: Could not get lock" in line: cant_get_lock = True + i = 0 cmd = ["apt-get", "dist-upgrade", "-y"] + APT_CHOOSE_OLD_FILES_OPTIONS while True: log.info(f"Executing: {' '.join(cmd)}") diff --git a/pleskdistup/common/src/util.py b/pleskdistup/common/src/util.py index e625042..dfbf9a8 100644 --- a/pleskdistup/common/src/util.py +++ b/pleskdistup/common/src/util.py @@ -9,13 +9,6 @@ # Returns standard output def logged_check_call(cmd: typing.Union[typing.Sequence[str], str], **kwargs) -> str: log.info(f"Running: {cmd!r}. Output:") - - # I believe we should be able pass argument to the subprocess function - # from the caller. So we have to inject stdout/stderr/universal_newlines - kwargs["stdout"] = subprocess.PIPE - kwargs["stderr"] = subprocess.STDOUT - kwargs["universal_newlines"] = True - stdout = [] def proc_stdout(line: str) -> None: