@tornado.web.asynchronous<EOL><INDENT>def post(self):<DEDENT>
def status_finish(ret):<EOL><INDENT>self.set_status(ret)<EOL>self.finish()<EOL><DEDENT>def kill_parent():<EOL><INDENT>status_finish(<NUM_LIT:200>)<EOL>logger.info("<STR_LIT>")<EOL>os.killpg(os.getppid(), signal.SIGTERM)<EOL><DEDENT>logger = logging.getLogger(__file__)<EOL>logger.info("<STR_LIT>")<EOL>data = dict(urlparse.parse_qsl(self.request.body))<EOL>sharedSecret = data.get('<STR_LIT>')<EOL>if sharedSecret != options.secret:<EOL><INDENT>status_finish(<NUM_LIT>)<EOL>return<EOL><DEDENT>instanceId = data.get('<STR_LIT>')<EOL>if instanceId:<EOL><INDENT>filepath = instanceId + '<STR_LIT>'<EOL>if os.path.isfile(filepath): <EOL><INDENT>if instanceId.startswith('<STR_LIT>'): <EOL><INDENT>kill_parent()<EOL><DEDENT>else: <EOL><INDENT>fh = open(filepath)<EOL>firstLine = int(fh.readline())<EOL>fh.close()<EOL>logger.info("<STR_LIT>" + instanceId + "<STR_LIT:U+0020>" + str(firstLine))<EOL>os.kill(firstLine, signal.SIGTERM)<EOL>status_finish(<NUM_LIT:200>)<EOL><DEDENT><DEDENT>else: <EOL><INDENT>logger.info(filepath + "<STR_LIT>")<EOL>status_finish(<NUM_LIT>)<EOL><DEDENT><DEDENT>else: <EOL><INDENT>kill_parent()<EOL><DEDENT>
post method