mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix lint issues
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
3f27139531
commit
b0df08334c
2 changed files with 7 additions and 3 deletions
|
@ -1299,7 +1299,7 @@ repos:
|
||||||
- id: nox
|
- id: nox
|
||||||
alias: lint-salt
|
alias: lint-salt
|
||||||
name: Lint Salt
|
name: Lint Salt
|
||||||
files: ^((setup|noxfile)|(salt|tasks)/.*)\.py$
|
files: ^((setup|noxfile)|(salt|tasks|tools)/.*)\.py$
|
||||||
exclude: >
|
exclude: >
|
||||||
(?x)^(
|
(?x)^(
|
||||||
templates/.*|
|
templates/.*|
|
||||||
|
|
|
@ -45,8 +45,11 @@ except ImportError:
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
# pylint: disable=no-name-in-module
|
||||||
from boto3.resources.factory.ec2 import Instance
|
from boto3.resources.factory.ec2 import Instance
|
||||||
|
|
||||||
|
# pylint: enable=no-name-in-module
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
REPO_ROOT = pathlib.Path(__file__).parent.parent
|
REPO_ROOT = pathlib.Path(__file__).parent.parent
|
||||||
|
@ -891,7 +894,7 @@ class VM:
|
||||||
description=f"SSH connection to {host} available!",
|
description=f"SSH connection to {host} available!",
|
||||||
completed=ssh_connection_timeout,
|
completed=ssh_connection_timeout,
|
||||||
)
|
)
|
||||||
return True
|
break
|
||||||
proc.wait(timeout=3)
|
proc.wait(timeout=3)
|
||||||
stderr = proc.stderr.read().strip()
|
stderr = proc.stderr.read().strip()
|
||||||
if stderr:
|
if stderr:
|
||||||
|
@ -921,6 +924,7 @@ class VM:
|
||||||
if last_error:
|
if last_error:
|
||||||
error += f". {last_error}"
|
error += f". {last_error}"
|
||||||
return error
|
return error
|
||||||
|
return True
|
||||||
|
|
||||||
def destroy(self):
|
def destroy(self):
|
||||||
try:
|
try:
|
||||||
|
@ -1206,7 +1210,7 @@ class VM:
|
||||||
pseudo_terminal: bool = False,
|
pseudo_terminal: bool = False,
|
||||||
env: list[str] = None,
|
env: list[str] = None,
|
||||||
log_command_level: int = logging.INFO,
|
log_command_level: int = logging.INFO,
|
||||||
ssh_options: list[str] | None = None,
|
ssh_options: list[str] | None = None, # pylint: disable=bad-whitespace
|
||||||
) -> list[str]:
|
) -> list[str]:
|
||||||
ssh = shutil.which("ssh")
|
ssh = shutil.which("ssh")
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|
Loading…
Add table
Reference in a new issue