Move requests import into pypsrp try-block

This commit is contained in:
Dag Wieers 2018-10-13 02:36:41 +02:00
parent 6693adc9b2
commit 820f9f9c1e

View file

@ -166,7 +166,6 @@ from ansible.plugins.connection import ConnectionBase
from ansible.plugins.shell.powershell import _common_args
from ansible.utils.hashing import secure_hash
from ansible.utils.path import makedirs_safe
from requests.exceptions import ConnectTimeout
HAS_PYPSRP = True
PYPSRP_IMP_ERR = None
@ -177,6 +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
except ImportError as err:
HAS_PYPSRP = False
PYPSRP_IMP_ERR = err