Browse Source

[liboozie] Update config checks

Do not check for workspace anymore as it is createad automatically if needed
Add check for Oozie server
Romain Rigaux 13 năm trước cách đây
mục cha
commit
c19deab3ec

+ 9 - 3
desktop/libs/liboozie/src/liboozie/conf.py

@@ -46,18 +46,24 @@ def config_validator():
   Called by core check_config() view.
   Called by core check_config() view.
   """
   """
   from hadoop.cluster import get_all_hdfs
   from hadoop.cluster import get_all_hdfs
+  from liboozie.oozie_api import get_oozie
 
 
   res = []
   res = []
 
 
+  status = 'down'
+  try:
+    status = str(get_oozie().get_oozie_status())
+  except:
+    pass
+  if 'NORMAL' not in status:
+    res.append((status, _('The Oozie server is not available')))
+
   class ConfigMock:
   class ConfigMock:
     def __init__(self, value): self.value = value
     def __init__(self, value): self.value = value
     def get(self): return self.value
     def get(self): return self.value
     def get_fully_qualifying_key(self): return self.value
     def get_fully_qualifying_key(self): return self.value
 
 
   for cluster in get_all_hdfs().values():
   for cluster in get_all_hdfs().values():
-    res.extend(validate_path(REMOTE_DEPLOYMENT_DIR, is_dir=True, fs=cluster,
-                             message=_('The deployment directory of Oozie workflows does not exist. '
-                                       'Run "Setup Examples" on the Oozie workflow page.')))
     res.extend(validate_path(ConfigMock('/user/oozie/share/lib'), is_dir=True, fs=cluster,
     res.extend(validate_path(ConfigMock('/user/oozie/share/lib'), is_dir=True, fs=cluster,
                              message=_('Oozie Share Lib not installed in default location.')))
                              message=_('Oozie Share Lib not installed in default location.')))