From 9adcb6605f74daa1998552e8efef7acc7ce23dee Mon Sep 17 00:00:00 2001 From: Mariano Scazzariello Date: Fri, 16 Dec 2022 00:02:09 +0100 Subject: [PATCH] Bump dockerpy version to 6.0.1 and remove patches for Windows (#199) --- setup.py | 2 +- src/Kathara/cli/command/ExecCommand.py | 6 ------ src/Kathara/foundation/test/Test.py | 7 ------- src/Kathara/manager/docker/DockerMachine.py | 6 ------ src/Kathara/manager/docker/DockerManager.py | 4 ++-- src/requirements.txt | 2 +- 6 files changed, 4 insertions(+), 23 deletions(-) diff --git a/setup.py b/setup.py index 41df3a9b..d0e21f4f 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ keywords=['NETWORK-EMULATION', 'CONTAINERS', 'NFV'], install_requires=[ "binaryornot>=0.4.4", - "docker>=4.4.4", + "docker>=6.0.1", "kubernetes>=23.3.0", "requests>=2.22.0", "coloredlogs>=10.0", diff --git a/src/Kathara/cli/command/ExecCommand.py b/src/Kathara/cli/command/ExecCommand.py index a0fd8b30..3f6dff1f 100644 --- a/src/Kathara/cli/command/ExecCommand.py +++ b/src/Kathara/cli/command/ExecCommand.py @@ -9,8 +9,6 @@ from ...parser.netkit.LabParser import LabParser from ...strings import strings, wiki_description -pywintypes = utils.import_pywintypes() - class ExecCommand(Command): def __init__(self) -> None: @@ -92,9 +90,5 @@ def run(self, current_path: str, argv: List[str]) -> None: sys.stdout.write(stdout) if stderr and not args['no_stderr']: sys.stderr.write(stderr) - except pywintypes.error as e: - (code, reason, _) = e.args - if code == 109 and reason == 'ReadFile': - pass except StopIteration: pass diff --git a/src/Kathara/foundation/test/Test.py b/src/Kathara/foundation/test/Test.py index 6cb404c0..ce9337bb 100644 --- a/src/Kathara/foundation/test/Test.py +++ b/src/Kathara/foundation/test/Test.py @@ -6,9 +6,6 @@ from ...manager.Kathara import Kathara from ...model.Lab import Lab -from ...utils import import_pywintypes - -pywintypes = import_pywintypes() class Test(ABC): @@ -49,9 +46,5 @@ def _get_machine_command_output(lab_hash, machine_name, command): result['stdout'] += stdout.decode('utf-8') if stderr: result['stderr'] += stderr.decode('utf-8') - except pywintypes.error as e: - (code, reason, _) = e.args - if code == 109 and reason == 'ReadFile': - pass except StopIteration: return result['stdout'], result['stderr'] diff --git a/src/Kathara/manager/docker/DockerMachine.py b/src/Kathara/manager/docker/DockerMachine.py index 636c7882..b695522b 100644 --- a/src/Kathara/manager/docker/DockerMachine.py +++ b/src/Kathara/manager/docker/DockerMachine.py @@ -19,8 +19,6 @@ from ...model.Machine import Machine from ...setting.Setting import Setting -pywintypes = utils.import_pywintypes() - RP_FILTER_NAMESPACE = "net.ipv4.conf.%s.rp_filter" # Known commands that each container should execute @@ -528,10 +526,6 @@ def connect(self, lab_hash: str, machine_name: str, user: str = None, shell: str while True: (stdout, _) = next(exec_output) startup_output += stdout.decode('utf-8') if stdout else "" - except pywintypes.error as e: - (code, reason, _) = e.args - if code == 109 and reason == 'ReadFile': - pass except StopIteration: pass diff --git a/src/Kathara/manager/docker/DockerManager.py b/src/Kathara/manager/docker/DockerManager.py index ab813e78..31cf1b66 100644 --- a/src/Kathara/manager/docker/DockerManager.py +++ b/src/Kathara/manager/docker/DockerManager.py @@ -23,9 +23,9 @@ from ...model.Link import Link from ...model.Machine import Machine from ...setting.Setting import Setting -from ...utils import pack_files_for_tar +from ...utils import pack_files_for_tar, import_pywintypes -pywintypes = utils.import_pywintypes() +pywintypes = import_pywintypes() def check_docker_status(method): diff --git a/src/requirements.txt b/src/requirements.txt index 99cf09e4..4b09ccc4 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,5 +1,5 @@ binaryornot>=0.4.4; -docker>=4.4.4; +docker>=6.0.1; kubernetes>=23.3.0; requests>=2.22.0; coloredlogs>=10.0;