]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Add dummy cfn-signal
authorAngus Salkeld <asalkeld@redhat.com>
Thu, 3 May 2012 04:34:57 +0000 (14:34 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Thu, 3 May 2012 04:45:01 +0000 (14:45 +1000)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
heat/cfntools/cfn-signal

index 0b5029047d60724686237d6bfc4831c0580ad3c6..5f8c1739fb1dfb3992ff15f4452180bf3a700d2e 100755 (executable)
 """
 Implements cfn-signal CloudFormation functionality
 """
+import argparse
+import logging
+import os
+import sys
+
+description = " "
+parser = argparse.ArgumentParser(description=description)
+parser.add_argument('-s', '--success',
+        dest="success",
+        help="signal status to report",
+        default='true',
+        required=False)
+parser.add_argument('-r', '--reason',
+        dest="reason",
+        help="The reason for the failure",
+        required=False)
+parser.add_argument('--data',
+        dest="data",
+        help="The data to send",
+        required=False)
+parser.add_argument('-i', '--id',
+        dest="unique_id",
+        help="the unique id to send back to the WaitCondition",
+        required=False)
+parser.add_argument('-e', '--exit',
+        dest="exit_code",
+        help="The exit code from a procecc to interpret",
+        required=False)
+parser.add_argument('url',
+                   help='the url to post to')
+args = parser.parse_args()
+
+log_format = '%(levelname)s [%(asctime)s] %(message)s'
+logging.basicConfig(format=log_format, level=logging.DEBUG)
+
+logger = logging.getLogger('cfn-init')
+#log_file_name = "/var/log/cfn-signal.log"
+#file_handler = logging.FileHandler(log_file_name)
+#file_handler.setFormatter(logging.Formatter(log_format))
+#logger.addHandler(file_handler)
+
+logger.info('cfn-signal called %s ' % (str(args)))
+