Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
4a157a72
Commit
4a157a72
authored
Aug 06, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch auth errors in winrm and properly raise errors
Fixes #7875
parent
6c3999b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lib/ansible/runner/connection_plugins/winrm.py
+5
-3
No files found.
lib/ansible/runner/connection_plugins/winrm.py
View file @
4a157a72
...
...
@@ -89,17 +89,19 @@ class Connection(object):
except
WinRMTransportError
,
exc
:
err_msg
=
str
(
exc
.
args
[
0
])
if
re
.
search
(
r'Operation\s+?timed\s+?out'
,
err_msg
,
re
.
I
):
raise
raise
errors
.
AnsibleError
(
"the connection attempt timed out"
)
m
=
re
.
search
(
r'Code\s+?(\d{3})'
,
err_msg
)
if
m
:
code
=
int
(
m
.
groups
()[
0
])
if
code
==
411
:
if
code
==
401
:
raise
errors
.
AnsibleError
(
"the username/password specified for this server was incorrect"
)
elif
code
==
411
:
_winrm_cache
[
cache_key
]
=
protocol
return
protocol
vvvv
(
'WINRM CONNECTION ERROR:
%
s'
%
err_msg
,
host
=
self
.
host
)
continue
if
exc
:
raise
e
xc
raise
e
rrors
.
AnsibleError
(
str
(
exc
))
def
_winrm_exec
(
self
,
command
,
args
=
(),
from_exec
=
False
):
if
from_exec
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment