Browse Source

HUE-4334 [editor] Update status to error when canceling batch job

Romain Rigaux 9 years ago
parent
commit
7d4e1cce97
1 changed files with 4 additions and 1 deletions
  1. 4 1
      desktop/libs/notebook/src/notebook/connectors/oozie_batch.py

+ 4 - 1
desktop/libs/notebook/src/notebook/connectors/oozie_batch.py

@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
 from desktop.lib.exceptions_renderable import PopupException
 from desktop.models import Document2
 
-from notebook.connectors.base import Api
+from notebook.connectors.base import Api, QueryError
 
 
 LOG = logging.getLogger(__name__)
@@ -72,6 +72,9 @@ class OozieApi(Api):
     job_id = snippet['result']['handle']['id']
     oozie_job = check_job_access_permission(self.request, job_id)
 
+    if oozie_job.status in ('KILLED', 'FAILED'):
+      raise QueryError(_('Job was %s') % oozie_job.status)
+
     response['status'] = 'running' if oozie_job.is_running() else 'available'
 
     return response