Sfoglia il codice sorgente

[liboozie] Disable config checks when the Oozie url is empty

Various other little UX improvements
Romain Rigaux 11 anni fa
parent
commit
fd9f250

+ 1 - 1
apps/beeswax/src/beeswax/views.py

@@ -305,7 +305,7 @@ def list_query_history(request):
                           Default to "-date".
     auto_query=<bool>   - Show auto generated actions (drop table, read data, etc). Default True
   """
-  DEFAULT_PAGE_SIZE = 30
+  DEFAULT_PAGE_SIZE = 100
   prefix = 'q-'
 
   share_queries = request.user.is_superuser

+ 1 - 1
desktop/conf.dist/hue.ini

@@ -660,7 +660,7 @@
 
 [liboozie]
   # The URL where the Oozie service runs on. This is required in order for
-  # users to submit jobs.
+  # users to submit jobs. Empty value disables the config check.
   ## oozie_url=http://localhost:11000/oozie
 
   # Requires FQDN in oozie_url if enabled

+ 1 - 1
desktop/conf/pseudo-distributed.ini.tmpl

@@ -667,7 +667,7 @@
 
 [liboozie]
   # The URL where the Oozie service runs on. This is required in order for
-  # users to submit jobs.
+  # users to submit jobs. Empty value disables the config check.
   ## oozie_url=http://localhost:11000/oozie
 
   # Requires FQDN in oozie_url if enabled

+ 1 - 2
desktop/libs/indexer/src/indexer/conf.py

@@ -21,7 +21,7 @@ from urlparse import urlparse
 
 from django.utils.translation import ugettext_lazy as _t
 
-from desktop.lib.conf import Config, coerce_bool
+from desktop.lib.conf import Config
 
 
 def solrctl():
@@ -60,7 +60,6 @@ CORE_INSTANCE_DIR = Config(
 CONFIG_TEMPLATE_PATH = Config(
   key="config_template_path",
   help=_t("Default template used at collection creation."),
-  private=True,
   type=str,
   default=os.path.join(os.path.dirname(__file__), '..', 'data', 'solrconfigs'))
 

+ 1 - 1
desktop/libs/indexer/src/indexer/controller.py

@@ -140,7 +140,7 @@ class CollectionManagerController(object):
                                      'SOLR_ZK_ENSEMBLE': conf.SOLR_ZK_ENSEMBLE.get()
                                    })
         if process.wait() != 0:
-          LOG.error("Cloud not delete instance directory.\nOutput stream: %s\nError stream: %s" % process.communicate())
+          LOG.error("Cloud not delete collection.\nOutput: %s\nError: %s" % process.communicate())
         raise PopupException(_('Could not create collection. Check error logs for more info.'))
     else:
       # Non-solrcloud mode

+ 13 - 11
desktop/libs/liboozie/src/liboozie/conf.py

@@ -24,7 +24,7 @@ from desktop.lib.conf import Config, coerce_bool, validate_path
 
 OOZIE_URL = Config(
   key='oozie_url',
-  help=_t('URL of Oozie server. This is required for job submission.'),
+  help=_t('URL of Oozie server. This is required for job submission. Empty value disables the config check.'),
   default='http://localhost:11000/oozie',
   type=str)
 
@@ -53,6 +53,7 @@ def get_oozie_status(user):
 
   return status
 
+
 def config_validator(user):
   """
   config_validator() -> [ (config_variable, error_message) ]
@@ -63,17 +64,18 @@ def config_validator(user):
 
   res = []
 
-  status = get_oozie_status(user)
-  if 'NORMAL' not in status:
-    res.append((status, _('The Oozie server is not available')))
+  if OOZIE_URL.get():
+    status = get_oozie_status(user)
+    if 'NORMAL' not in status:
+      res.append((status, _('The Oozie server is not available')))
 
-  class ConfigMock:
-    def __init__(self, value): self.value = value
-    def get(self): return self.value
-    def get_fully_qualifying_key(self): return self.value
+    class ConfigMock:
+      def __init__(self, value): self.value = value
+      def get(self): return self.value
+      def get_fully_qualifying_key(self): return self.value
 
-  for cluster in get_all_hdfs().values():
-    res.extend(validate_path(ConfigMock('/user/oozie/share/lib'), is_dir=True, fs=cluster,
-                             message=_('Oozie Share Lib not installed in default location.')))
+    for cluster in get_all_hdfs().values():
+      res.extend(validate_path(ConfigMock('/user/oozie/share/lib'), is_dir=True, fs=cluster,
+                               message=_('Oozie Share Lib not installed in default location.')))
 
   return res