Changed response on /minions from 302 to 202

Arguably this is a more appropriate response code. In addition, the
original intent with the 302 was to supply the job ID in order to be
able to reference it later, however 3XX responses are not available via
the XHR object in browsers nor do they communicate intent.
This commit is contained in:
Seth House 2013-01-18 10:32:18 -07:00
parent a7a8b9787d
commit ab396c358a

View File

@ -485,7 +485,11 @@ class Minions(LowDataAdapter):
for chunk in cherrypy.request.lowstate: for chunk in cherrypy.request.lowstate:
chunk['client'] = 'local_async' chunk['client'] = 'local_async'
job_data = next(self.exec_lowstate(), {}) job_data = next(self.exec_lowstate(), {})
raise cherrypy.HTTPRedirect('/jobs/{jid}'.format(**job_data), 302)
cherrypy.response.status = 202
return [{
'return': job_data,
}]
class Jobs(LowDataAdapter): class Jobs(LowDataAdapter):
def GET(self, jid=None): def GET(self, jid=None):