浏览代码

[oozie] Fix date conversion test

Romain Rigaux 11 年之前
父节点
当前提交
3fa2107
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 3 1
      apps/oozie/src/oozie/views/dashboard.py
  2. 2 2
      desktop/libs/hadoop/src/hadoop/cluster.py

+ 3 - 1
apps/oozie/src/oozie/views/dashboard.py

@@ -727,8 +727,10 @@ def massaged_bundle_actions_for_json(bundle):
 def format_time(st_time):
   if st_time is None:
     return '-'
-  else:
+  elif type(st_time) == time.struct_time:
     return time.strftime("%a, %d %b %Y %H:%M:%S", st_time)
+  else:
+    return st_time
 
 
 def massaged_oozie_jobs_for_json(oozie_jobs, user, just_sla=False):

+ 2 - 2
desktop/libs/hadoop/src/hadoop/cluster.py

@@ -172,9 +172,9 @@ def get_next_ha_yarncluster():
   for name in conf.YARN_CLUSTERS.keys():
     config = conf.YARN_CLUSTERS[name]
     if config.SUBMIT_TO.get():
+      rm = ResourceManagerApi(config.RESOURCE_MANAGER_API_URL.get(), config.SECURITY_ENABLED.get())
       if has_ha:
-        try:
-          rm = ResourceManagerApi(config.RESOURCE_MANAGER_API_URL.get(), config.SECURITY_ENABLED.get())
+        try:          
           cluster_info = rm.cluster()
           if cluster_info['clusterInfo']['haState'] == 'ACTIVE':
             MR_NAME_CACHE = name