Ver código fonte

HUE-3228 [dashboard] Only enable Solr in the default config

Romain Rigaux 8 anos atrás
pai
commit
fe1f946b2a

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -793,6 +793,9 @@
   ## Activate the Dashboard link in the menu.
   ## Activate the Dashboard link in the menu.
   # is_enabled=true
   # is_enabled=true
 
 
+  ## Activate the SQL Dashboard (beta).
+  # has_sql_enabled=false
+
   [[engines]]
   [[engines]]
 
 
     #  [[[solr]]]
     #  [[[solr]]]

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -795,6 +795,9 @@
   ## Activate the Dashboard link in the menu.
   ## Activate the Dashboard link in the menu.
   # is_enabled=true
   # is_enabled=true
 
 
+  ## Activate the SQL Dashboard (beta).
+  # has_sql_enabled=false
+
   [[engines]]
   [[engines]]
 
 
     #  [[[solr]]]
     #  [[[solr]]]

+ 10 - 3
desktop/libs/dashboard/src/dashboard/conf.py

@@ -17,6 +17,7 @@
 
 
 from django.utils.translation import ugettext as _, ugettext_lazy as _t
 from django.utils.translation import ugettext as _, ugettext_lazy as _t
 
 
+from desktop.conf import is_hue4
 from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection, coerce_bool
 from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection, coerce_bool
 from desktop.appmanager import get_apps_dict
 from desktop.appmanager import get_apps_dict
 from notebook.conf import get_ordered_interpreters
 from notebook.conf import get_ordered_interpreters
@@ -25,8 +26,14 @@ from notebook.conf import get_ordered_interpreters
 IS_ENABLED = Config(
 IS_ENABLED = Config(
   key="is_enabled",
   key="is_enabled",
   help=_t("Activate the Dashboard link in the menu."),
   help=_t("Activate the Dashboard link in the menu."),
-  default=True,
-  private=True,
+  dynamic_default=is_hue4,
+  type=coerce_bool
+)
+
+HAS_SQL_ENABLED = Config(
+  key="has_sql_enabled",
+  help=_t("Activate the SQL Dashboard (beta)."),
+  dynamic_default=is_hue4,
   type=coerce_bool
   type=coerce_bool
 )
 )
 
 
@@ -65,7 +72,7 @@ def get_engines(user):
       'nesting': settings.get('solr') and settings['solr'].get('nesting'),
       'nesting': settings.get('solr') and settings['solr'].get('nesting'),
     })
     })
 
 
-  if 'beeswax' in apps or 'rdbms' in apps:
+  if HAS_SQL_ENABLED.get() and ('beeswax' in apps or 'rdbms' in apps):
     engines += [{
     engines += [{
           'name': _('table (%s)') % interpreter['name'],
           'name': _('table (%s)') % interpreter['name'],
           'type': interpreter['type'],
           'type': interpreter['type'],