diff options
author | tyagi <ishant.tyagi@hp.com> | 2015-05-29 03:37:18 -0700 |
---|---|---|
committer | tyagi <ishant.tyagi@hp.com> | 2015-06-04 01:06:04 -0700 |
commit | 791046046e4b58674b094a363932908ccc18118c (patch) | |
tree | aa5dca1227b3a41ece67d1b8cf8657a7ee99d856 | |
parent | 02acffbe2a271118f17639035b40c1a92848686f (diff) | |
download | heat-cfntools-791046046e4b58674b094a363932908ccc18118c.tar.gz |
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
-rwxr-xr-x | bin/cfn-signal | 11 |
1 files 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) |