diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 75069bc..894a733 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ ci: skip: - add-trailing-comma # v3.0.0 only supports Python >=3.6 - flake8 # This is kept at v4 for until WPS starts supporting flake v5 + - pylint # Getting exceptions running with pylint >=3 repos: - repo: https://github.com/asottile/add-trailing-comma.git @@ -13,7 +14,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/Lucas-C/pre-commit-hooks.git - rev: v1.5.1 + rev: v1.5.4 hooks: - id: remove-tabs @@ -30,7 +31,7 @@ repos: ^.*\.rst$ - repo: https://github.com/pre-commit/pre-commit-hooks.git - rev: v4.4.0 + rev: v4.5.0 hooks: # Side-effects: - id: trailing-whitespace @@ -72,7 +73,7 @@ repos: - id: debug-statements - repo: https://github.com/adrienverge/yamllint.git - rev: v1.32.0 + rev: v1.33.0 hooks: - id: yamllint types: @@ -82,7 +83,7 @@ repos: - --strict - repo: https://github.com/PyCQA/flake8.git - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 alias: flake8-no-wps @@ -114,8 +115,5 @@ repos: rev: v2.15.9 hooks: - id: pylint - additional_dependencies: - - ansible-core ~= 2.14.0b1 - - pylint-pytest < 1.1.0 ... diff --git a/.pylintrc b/.pylintrc index 124c3d3..75a14fd 100644 --- a/.pylintrc +++ b/.pylintrc @@ -598,5 +598,5 @@ preferred-modules= # Exceptions that will emit a warning when being caught. Defaults to # "BaseException, Exception". overgeneral-exceptions= - BaseException, - Exception, + builtins.BaseException, + builtins.Exception, diff --git a/plugins/modules/parallels_desktop.py b/plugins/modules/parallels_desktop.py index 8b53935..f991531 100644 --- a/plugins/modules/parallels_desktop.py +++ b/plugins/modules/parallels_desktop.py @@ -651,22 +651,22 @@ def ensure_app_terminated( # noqa: WPS231 'msg': str(lookup_error), 'changed': False, } - else: - terminate_parallels = process_syscall_errors( - partial(os.kill, parallels_pid, signal.SIGTERM), - ) - destroy_parallels = process_syscall_errors( - partial(os.kill, parallels_pid, signal.SIGKILL), - ) - parallels_termination_stages = ( - ( - 'terminated', - self.kindly_ask_parallels_desktop_app_to_quit, - 100, - ), - ('killed', terminate_parallels, 100), - ('murdered', destroy_parallels, 5), - ) + + terminate_parallels = process_syscall_errors( + partial(os.kill, parallels_pid, signal.SIGTERM), + ) + destroy_parallels = process_syscall_errors( + partial(os.kill, parallels_pid, signal.SIGKILL), + ) + parallels_termination_stages = ( + ( + 'terminated', + self.kindly_ask_parallels_desktop_app_to_quit, + 100, + ), + ('killed', terminate_parallels, 100), + ('murdered', destroy_parallels, 5), + ) self.ensure_running_vms_stopped()