소스 검색

HUE-734 Job designer link to job browser

abec 13 년 전
부모
커밋
3d09714

+ 1 - 1
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -67,7 +67,7 @@ class HiveServerTable(Table):
   @property
   def cols(self):
     cols = HiveServerTTableSchema(self.results, self.schema).cols()
-    if all([col['col_name'] for col in cols]):
+    if sum([col['col_name'] for col in cols]) == len(cols):
       return cols
     else:
       return cols[:-2] # Drop last 2 lines of Extended describe

+ 1 - 1
apps/jobbrowser/src/jobbrowser/tests.py

@@ -155,7 +155,7 @@ class TestJobBrowserWithHadoop(unittest.TestCase, OozieServerProvider):
     design_id = designs[0]['id']
     response = self.client.post("/jobsub/submit_design/%d" % design_id, follow=True)
     oozie_jobid = response.context['jobid']
-    job = OozieServerProvider.wait_until_completion(oozie_jobid, timeout=500, step=1)
+    OozieServerProvider.wait_until_completion(oozie_jobid, timeout=500, step=1)
     hadoop_job_id = get_hadoop_job_id(self.oozie, oozie_jobid, 1)
 
     # Select only killed jobs (should be absent)

+ 6 - 1
apps/jobsub/src/jobsub/templates/workflow.mako

@@ -125,7 +125,12 @@ ${layout.menubar(section='history')}
                 </td>
                 <td>${action.type}</td>
                 <td>${action.status}</td>
-                <td>${action.externalId}</td>
+
+                <td>
+                % if action.externalId:
+                  <a href="${ url('jobbrowser.views.single_job', jobid=action.externalId) }">${ action.externalId }</a>
+                % endif
+                </td>
 
                 <td>${format_time(action.startTime)}</td>
                 <td>${format_time(action.endTime)}</td>

+ 2 - 2
apps/jobsub/src/jobsub/tests.py

@@ -257,7 +257,7 @@ class TestJobsubWithHadoop(OozieServerProvider):
         'map_sleep_time': 1,
         'reduce_sleep_time': 1}, follow=True)
 
-    assert_true(any([status in response.content for status in ('PREP', 'OK', 'DONE')]), response.content)
+    assert_true(sum([status in response.content for status in ('PREP', 'OK', 'DONE')]) > 0)
     assert_true(str(jobid) in response.content)
 
     oozie_job_id = response.context['jobid']
@@ -282,7 +282,7 @@ class TestJobsubWithHadoop(OozieServerProvider):
         'map_sleep_time': 1,
         'reduce_sleep_time': 1}, follow=True)
 
-    assert_true(any([status in response.content for status in ('PREP', 'OK', 'DONE')]), response.content)
+    assert_true(sum([status in response.content for status in ('PREP', 'OK', 'DONE')]) > 0)
     assert_true(str(jobid) in response.content)
 
     oozie_job_id = response.context['jobid']

+ 0 - 1
desktop/libs/liboozie/src/liboozie/oozie_api.py

@@ -153,7 +153,6 @@ class OozieApi(object):
     """
     params = self._get_params()
     resp = self._root.get('job/%s' % (jobid,), params)
-    print resp
     wf = Workflow(self, resp)
     return wf
 

+ 0 - 1
desktop/libs/liboozie/src/liboozie/submittion.py

@@ -86,7 +86,6 @@ class Submission(object):
       raise PopupException(message=msg, detail=str(ex))
 
     oozie_xml = self.job.to_xml()
-    print oozie_xml
     self._do_as(self.user.username , self._copy_files, deployment_dir, oozie_xml)
 
     return deployment_dir

+ 3 - 0
desktop/libs/liboozie/src/liboozie/types.py

@@ -91,6 +91,7 @@ class ControlFlowAction(Action):
     Fixup:
       - time fields as struct_time
       - config dict
+      - protect externalId
     """
     super(ControlFlowAction, self)._fixup()
 
@@ -100,6 +101,8 @@ class ControlFlowAction(Action):
       self.endTime = parse_timestamp(self.endTime)
     if self.retries:
       self.retries = int(self.retries)
+    if self.externalId and not re.match('job_.*', self.externalId):
+      self.externalId = None
 
     self.conf_dict = {}