From b0df08334c2762d35e1a2bf27c49ad89154b4ce8 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 17 Jan 2023 04:40:14 +0000 Subject: [PATCH] Fix lint issues Signed-off-by: Pedro Algarvio --- .pre-commit-config.yaml | 2 +- tools/vm.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6ee79c07d4..c0e21e80c98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1299,7 +1299,7 @@ repos: - id: nox alias: lint-salt name: Lint Salt - files: ^((setup|noxfile)|(salt|tasks)/.*)\.py$ + files: ^((setup|noxfile)|(salt|tasks|tools)/.*)\.py$ exclude: > (?x)^( templates/.*| diff --git a/tools/vm.py b/tools/vm.py index 3bada709bb8..77e4f90097c 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -45,8 +45,11 @@ except ImportError: if TYPE_CHECKING: + # pylint: disable=no-name-in-module from boto3.resources.factory.ec2 import Instance + # pylint: enable=no-name-in-module + log = logging.getLogger(__name__) REPO_ROOT = pathlib.Path(__file__).parent.parent @@ -891,7 +894,7 @@ class VM: description=f"SSH connection to {host} available!", completed=ssh_connection_timeout, ) - return True + break proc.wait(timeout=3) stderr = proc.stderr.read().strip() if stderr: @@ -921,6 +924,7 @@ class VM: if last_error: error += f". {last_error}" return error + return True def destroy(self): try: @@ -1206,7 +1210,7 @@ class VM: pseudo_terminal: bool = False, env: list[str] = None, log_command_level: int = logging.INFO, - ssh_options: list[str] | None = None, + ssh_options: list[str] | None = None, # pylint: disable=bad-whitespace ) -> list[str]: ssh = shutil.which("ssh") if TYPE_CHECKING: