Skip to content

Commit

Permalink
Fix: Fix ssh connection error test case
Browse files Browse the repository at this point in the history
Catch an additional paramiko exception that is not derived from
SSHException while trying to create a ssh connection and convert it to a
GvmError.
  • Loading branch information
bjoernricks committed Apr 3, 2023
1 parent 65ba645 commit 8370652
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gvm/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from typing import Optional, Union

import paramiko
import paramiko.ssh_exception
from lxml import etree

from gvm.errors import GvmError
Expand Down Expand Up @@ -380,6 +381,7 @@ def connect(self) -> None:
paramiko.BadHostKeyException,
paramiko.AuthenticationException,
paramiko.SSHException,
paramiko.ssh_exception.NoValidConnectionsError,
ConnectionError,
) as e:
raise GvmError(f"SSH Connection failed: {e}") from None
Expand Down

0 comments on commit 8370652

Please sign in to comment.