Merge "Change cfn-signal option --exit to --exit-code"

This commit is contained in:
Jenkins 2013-09-08 14:43:05 +00:00 committed by Gerrit Code Review
commit ed5365dffe
1 changed files with 11 additions and 4 deletions

View File

@ -45,11 +45,16 @@ parser.add_argument('-i', '--id',
help="the unique id to send back to the WaitCondition",
default='00000',
required=False)
parser.add_argument('-e', '--exit',
parser.add_argument('-e', '--exit-code',
dest="exit_code",
help="The exit code from a procecc to interpret",
default=None,
required=False)
parser.add_argument('--exit',
dest="exit",
help="DEPRECATED! Use -e or --exit-code instead.",
default=None,
required=False)
parser.add_argument('url',
help='the url to post to')
args = parser.parse_args()
@ -64,11 +69,13 @@ file_handler.setFormatter(logging.Formatter(log_format))
LOG.addHandler(file_handler)
LOG.debug('cfn-signal called %s ' % (str(args)))
if args.exit:
LOG.warning('--exit DEPRECATED! Use -e or --exit-code instead.')
status = 'FAILURE'
if args.exit_code:
exit_code = args.exit_code or args.exit
if exit_code:
# "exit_code" takes presedence over "success".
if args.exit_code == '0':
if exit_code == '0':
status = 'SUCCESS'
else:
if args.success == 'true':