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
898c7cc0
Commit
898c7cc0
authored
Jul 07, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11515 from msabramo/nicer_output_for_parser_errors
Don't wrap text for AnsibleParserError
parents
08fcd823
314bae2a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
bin/ansible
+1
-1
lib/ansible/utils/display.py
+4
-1
No files found.
bin/ansible
View file @
898c7cc0
...
...
@@ -80,7 +80,7 @@ if __name__ == '__main__':
display
.
error
(
str
(
e
))
sys
.
exit
(
5
)
except
AnsibleParserError
as
e
:
display
.
error
(
str
(
e
))
display
.
error
(
str
(
e
)
,
wrap_text
=
False
)
sys
.
exit
(
4
)
# TQM takes care of these, but leaving comment to reserve the exit codes
# except AnsibleHostUnreachable as e:
...
...
lib/ansible/utils/display.py
View file @
898c7cc0
...
...
@@ -182,10 +182,13 @@ class Display:
(
out
,
err
)
=
cmd
.
communicate
()
self
.
display
(
"
%
s
\n
"
%
out
,
color
=
color
)
def
error
(
self
,
msg
):
def
error
(
self
,
msg
,
wrap_text
=
True
):
if
wrap_text
:
new_msg
=
"
\n
[ERROR]:
%
s"
%
msg
wrapped
=
textwrap
.
wrap
(
new_msg
,
79
)
new_msg
=
"
\n
"
.
join
(
wrapped
)
+
"
\n
"
else
:
new_msg
=
msg
if
new_msg
not
in
self
.
_errors
:
self
.
display
(
new_msg
,
color
=
'red'
,
stderr
=
True
)
self
.
_errors
[
new_msg
]
=
1
...
...
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