def action(self, appid, action): request = MockDjangoRequest(self.user) manage_oozie_jobs(request, action) if action == 'change' or action == 'ignore' or ',' not in appid: return manage_oozie_jobs(request, action) else: return bulk_manage_oozie_jobs(request)
def action(self, appid, action): if action == 'change' or action == 'ignore' or ',' not in appid: request = MockDjangoRequest(self.user) response = manage_oozie_jobs(request, appid, action['action']) else: request = MockDjangoRequest(self.user, post={'job_ids': appid, 'action': action['action']}) response = bulk_manage_oozie_jobs(request) return json.loads(response.content)
def _manage_oozie_job(user, action, app_ids): if action == 'change' or action == 'ignore' or len(app_ids) == 1: request = MockDjangoRequest(user) response = manage_oozie_jobs(request, app_ids[0], action['action']) else: request = MockDjangoRequest(user, post={'job_ids': ' '.join(app_ids), 'action': action['action']}) response = bulk_manage_oozie_jobs(request) result = json.loads(response.content) result['status'] = result.get('totalErrors', 0) result['message'] = _('%s action sent to %s jobs') % (action['action'], result.get('totalRequests', 1)) return result
def _manage_oozie_job(user, action, app_ids): if action == 'change' or action == 'ignore' or len(app_ids) == 1: request = MockDjangoRequest(user) response = manage_oozie_jobs(request, app_ids[0], action['action']) else: request = MockDjangoRequest(user, post={'job_ids': ' '.join(app_ids), 'action': action['action']}) response = bulk_manage_oozie_jobs(request) result = json.loads(response.content) result['status'] = result.get('totalErrors', 0) result['message'] = _('%s action sent to %s jobs') % (action['action'], result.get('totalRequests', 1)) return result
def action(self, appid, action): if action == 'change' or action == 'ignore' or ',' not in appid: request = MockDjangoRequest(self.user) response = manage_oozie_jobs(request, appid, action['action']) else: request = MockDjangoRequest(self.user, post={ 'job_ids': appid, 'action': action['action'] }) response = bulk_manage_oozie_jobs(request) return json.loads(response.content)