add wait option to POST /commands

This commit is contained in:
Jim Rollenhagen 2014-02-19 21:25:32 -08:00
parent 6a615e07fe
commit a4ec4bfd0a

View File

@ -73,6 +73,11 @@ class TeethAgentAPI(component.APIComponent):
"""Execute a command on the agent."""
command = AgentCommand.deserialize(self.parse_content(request))
result = self.agent.execute_command(command.name, **command.params)
wait = request.args.get('wait')
if wait and wait.lower() == 'true':
result.join()
return responses.ItemResponse(result)
def get_command_result(self, request, result_id):