summaryrefslogtreecommitdiff
path: root/bin/ansible
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2015-05-13 11:15:04 -0400
committerBrian Coca <brian.coca+git@gmail.com>2015-05-13 11:15:32 -0400
commitb85ce3883451e20c7869dce39d795ba6cf62ed08 (patch)
tree2b0848875ed0d6e49e5daf2fd03f44a168476d19 /bin/ansible
parent079fca27a20aefef17d3b572f6934c3d1d4e0040 (diff)
downloadansible-b85ce3883451e20c7869dce39d795ba6cf62ed08.tar.gz
slight changes to error handling to align with v1
Diffstat (limited to 'bin/ansible')
-rwxr-xr-xbin/ansible18
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/ansible b/bin/ansible
index 467dd505a2..12ad89fcff 100755
--- a/bin/ansible
+++ b/bin/ansible
@@ -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)