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
b85ce388
Commit
b85ce388
authored
May 13, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slight changes to error handling to align with v1
parent
079fca27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
bin/ansible
+14
-4
lib/ansible/cli/adhoc.py
+1
-1
No files found.
bin/ansible
View file @
b85ce388
...
...
@@ -35,7 +35,7 @@ except Exception:
import
os
import
sys
from
ansible.errors
import
AnsibleError
,
AnsibleOptionsError
from
ansible.errors
import
AnsibleError
,
AnsibleOptionsError
,
AnsibleParserError
from
ansible.utils.display
import
Display
########################################################
...
...
@@ -70,10 +70,20 @@ if __name__ == '__main__':
except
AnsibleOptionsError
as
e
:
cli
.
parser
.
print_help
()
display
.
display
(
str
(
e
),
stderr
=
True
,
color
=
'red'
)
sys
.
exit
(
1
)
sys
.
exit
(
5
)
except
AnsibleParserError
as
e
:
display
.
display
(
str
(
e
),
stderr
=
True
,
color
=
'red'
)
sys
.
exit
(
4
)
# TQM takes care of these, but leaving comment to reserve the exit codes
# except AnsibleHostUnreachable as e:
# display.display(str(e), stderr=True, color='red')
# sys.exit(3)
# except AnsibleHostFailed as e:
# display.display(str(e), stderr=True, color='red')
# sys.exit(2)
except
AnsibleError
as
e
:
display
.
display
(
str
(
e
),
stderr
=
True
,
color
=
'red'
)
sys
.
exit
(
2
)
sys
.
exit
(
1
)
except
KeyboardInterrupt
:
display
.
error
(
"interrupted"
)
sys
.
exit
(
4
)
sys
.
exit
(
99
)
lib/ansible/cli/adhoc.py
View file @
b85ce388
...
...
@@ -105,7 +105,7 @@ class AdHocCLI(CLI):
return
0
if
self
.
options
.
module_name
in
C
.
MODULE_REQUIRE_ARGS
and
not
self
.
options
.
module_args
:
raise
AnsibleError
(
"No argument passed to
%
s module"
%
self
.
options
.
module_name
)
raise
Ansible
Options
Error
(
"No argument passed to
%
s module"
%
self
.
options
.
module_name
)
#TODO: implement async support
#if self.options.seconds:
...
...
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