Skip to content

Commit 50c9ced

Browse files
jpicphilpep
authored andcommitted
Allow transport override on winrm backend
1 parent c99c289 commit 50c9ced

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

doc/source/backends.rst

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ The winrm backend uses `pywinrm <https://pypi.python.org/pypi/pywinrm>`_::
178178

179179
$ py.test --hosts='winrm://Administrator:Password@127.0.0.1'
180180
$ py.test --hosts='winrm://vagrant@127.0.0.1:2200?no_ssl=true&no_verify_ssl=true'
181+
$ py.test --hosts='winrm://vagrant@127.0.0.1:2200?no_ssl=true&no_verify_ssl=true&transport=plaintext'
181182

182183
pywinrm's default read and operation timeout can be overridden using query
183184
arguments ``read_timeout_sec`` and ``operation_timeout_sec``::

testinfra/backend/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def parse_hostspec(hostspec: str) -> tuple[str, dict[str, Any]]:
6464
"controlpersist",
6565
"kubeconfig",
6666
"context",
67+
"transport",
6768
):
6869
if key in query:
6970
kw[key] = query[key][0]

testinfra/backend/winrm.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(
5656
no_verify_ssl: bool = False,
5757
read_timeout_sec: Optional[int] = None,
5858
operation_timeout_sec: Optional[int] = None,
59+
transport: str = None,
5960
*args: Any,
6061
**kwargs: Any,
6162
):
@@ -66,7 +67,7 @@ def __init__(
6667
self.host.name,
6768
":{}".format(self.host.port) if self.host.port else "",
6869
),
69-
"transport": "ntlm",
70+
"transport": transport or "ntlm",
7071
"username": self.host.user,
7172
"password": self.host.password,
7273
}

0 commit comments

Comments
 (0)