From 791046046e4b58674b094a363932908ccc18118c Mon Sep 17 00:00:00 2001 From: tyagi Date: Fri, 29 May 2015 03:37:18 -0700 Subject: Add --insecure/-k option to cfn-signal cfn-signal will not work when heat-cfn-api server is configured for the https. This patch will provide a option to make a insecure request to the cfn server. Change-Id: I9dcd53b40a389811e292c331ff625a8b5af827b7 Closes-Bug: 1460007 --- bin/cfn-signal | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/cfn-signal b/bin/cfn-signal index e3d1190..63f23cc 100755 --- a/bin/cfn-signal +++ b/bin/cfn-signal @@ -57,6 +57,9 @@ parser.add_argument('--exit', required=False) parser.add_argument('url', help='the url to post to') +parser.add_argument('-k', '--insecure', + help="This will make insecure https request to cfn-api.", + action='store_true') args = parser.parse_args() log_format = '%(levelname)s [%(asctime)s] %(message)s' @@ -98,8 +101,12 @@ body = { "Data": args.data } -cmd_str = "curl -X PUT -H \'Content-Type:\' --data-binary \'%s\' \"%s\"" % \ - (cfn_helper.json.dumps(body), args.url) +insecure = "" +if args.insecure: + insecure = "--insecure" + +cmd_str = ("curl %s -X PUT -H \'Content-Type:\' --data-binary \'%s\' \"%s\"" % + (insecure, cfn_helper.json.dumps(body), args.url)) command = cfn_helper.CommandRunner(cmd_str).run() if command.status != 0: LOG.error(command.stderr) -- cgit v1.2.1