mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-12 03:14:24 -07:00
Use sys.exit(msg) i/o print() and sys.exit() (#15465)
Any non-0 exits should be showing an error message to stderr instead of to stdout.
This commit is contained in:
parent
76f9935634
commit
57a911e098
10 changed files with 22 additions and 37 deletions
|
@ -126,6 +126,7 @@ be used to access the machine.
|
|||
import os
|
||||
import re
|
||||
import argparse
|
||||
import sys
|
||||
from time import time
|
||||
import sys
|
||||
import ConfigParser
|
||||
|
@ -191,9 +192,8 @@ except ImportError:
|
|||
try:
|
||||
import consul
|
||||
except ImportError as e:
|
||||
print("""failed=True msg='python-consul required for this module. see
|
||||
http://python-consul.readthedocs.org/en/latest/#installation'""")
|
||||
sys.exit(1)
|
||||
sys.exit("""failed=True msg='python-consul required for this module.
|
||||
See http://python-consul.readthedocs.org/en/latest/#installation'""")
|
||||
|
||||
from six import iteritems
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue