Add ConnectionError too
This commit is contained in:
parent
7cc78c5a04
commit
5fa51f3cd8
1 changed files with 2 additions and 2 deletions
|
@ -176,7 +176,7 @@ try:
|
|||
from pypsrp.powershell import PowerShell, RunspacePool
|
||||
from pypsrp.shell import Process, SignalCode, WinRS
|
||||
from pypsrp.wsman import WSMan, AUTH_KWARGS
|
||||
from requests.exceptions import ConnectTimeout
|
||||
from requests.exceptions import ConnectionError, ConnectTimeout
|
||||
except ImportError as err:
|
||||
HAS_PYPSRP = False
|
||||
PYPSRP_IMP_ERR = err
|
||||
|
@ -244,7 +244,7 @@ class Connection(ConnectionBase):
|
|||
"psrp connection failure during runspace open: %s"
|
||||
% to_native(e)
|
||||
)
|
||||
except ConnectTimeout as e:
|
||||
except (ConnectionError, ConnectTimeout) as e:
|
||||
raise AnsibleConnectionFailure(
|
||||
"Failed to connect to the host via PSRP: %s"
|
||||
% to_native(e)
|
||||
|
|
Loading…
Reference in a new issue