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
859c572d
Commit
859c572d
authored
Feb 28, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always show return codes (seems like a reasonable thing to do), make one line output slightly more
obvious
parent
cc2d3e0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
bin/ans-command
+2
-9
No files found.
bin/ans-command
View file @
859c572d
...
...
@@ -33,8 +33,6 @@ def main(args):
parser
=
base_ans_parser
()
parser
.
usage
=
"ans-command [options] command-to-run"
parser
.
add_option
(
'-c'
,
'--return-codes'
,
dest
=
'return_codes'
,
action
=
'store_true'
,
help
=
"prefix each line with the command's return code"
)
parser
.
add_option
(
'-1'
,
'--one-line'
,
dest
=
'one_line'
,
action
=
'store_true'
,
help
=
"output results on one line to make grepping easier, however will
\
not remove newlines from command output"
)
...
...
@@ -95,14 +93,9 @@ def main(args):
continue
if
options
.
one_line
:
if
options
.
return_codes
:
print
'
%
s:
%
s:
%
s:
%
s'
%
(
hn
,
d
[
'rc'
],
d
[
'stdout'
],
d
[
'stderr'
])
else
:
print
'
%
s:
%
s:
%
s'
%
(
hn
,
d
[
'stdout'
],
d
[
'stderr'
])
print
'
%
s | rc=
%
s |
%
s:
%
s'
%
(
hn
,
d
[
'rc'
],
d
[
'stdout'
],
d
[
'stderr'
])
else
:
print
'
%
s:'
%
hn
if
options
.
return_codes
:
print
'return code:
%
s
\n
'
%
d
[
'rc'
]
print
"
%
s: => rc=
%
s"
%
(
hn
,
d
[
'rc'
])
print
'
%
s'
%
d
[
'stdout'
]
if
d
.
get
(
'stderr'
,
None
):
print
'
%
s'
%
d
[
'stderr'
]
...
...
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