Răsfoiți Sursa

HUE-5968 [fb] Enable batch extractor flag by default

krish 8 ani în urmă
părinte
comite
d5fde8a

+ 2 - 1
apps/filebrowser/src/filebrowser/conf.py

@@ -19,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _
 
 from desktop.conf import ENABLE_DOWNLOAD
 from desktop.lib.conf import Config, coerce_bool
+from desktop.conf import is_oozie_enabled
 
 
 MAX_SNAPPY_DECOMPRESSION_SIZE = Config(
@@ -55,5 +56,5 @@ ENABLE_EXTRACT_UPLOADED_ARCHIVE = Config(
   key="enable_extract_uploaded_archive",
   help=_("Flag to enable the extraction of a uploaded archive in HDFS."),
   type=bool,
-  default=False
+  dynamic_default=is_oozie_enabled
 )

+ 1 - 1
apps/filebrowser/src/filebrowser/templates/listdir.mako

@@ -99,7 +99,7 @@ ${ fb_components.menubar() }
                   <i class="fa fa-fw fa-hdd-o"></i> ${_('Set replication')}
                 </a>
               </li>
-              % if ENABLE_EXTRACT_UPLOADED_ARCHIVE.get():
+              % if ENABLE_EXTRACT_UPLOADED_ARCHIVE.get() and 'oozie' in apps:
                 <li><a href="javascript: void(0)" title="${_('Compress selection into a single archive')}" data-bind="click: function() { setCompressArchiveDefault(); confirmCompressFiles();}, visible: showCompressButton">
                   <i class="fa fa-fw fa-file-archive-o"></i> ${_('Compress')}</a>
                 </li>

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

@@ -1164,7 +1164,7 @@
   ## show_upload_button=false
 
   # Flag to enable the extraction of a uploaded archive in HDFS.
-  ## enable_extract_uploaded_archive=false
+  ## enable_extract_uploaded_archive=true
 
 
 ###########################################################################

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

@@ -1163,7 +1163,7 @@
   ## show_upload_button=false
 
   # Flag to enable the extraction of a uploaded archive in HDFS.
-  ## enable_extract_uploaded_archive=false
+  ## enable_extract_uploaded_archive=true
 
 
 ###########################################################################

+ 5 - 0
desktop/core/src/desktop/conf.py

@@ -33,6 +33,7 @@ from django.utils.translation import ugettext_lazy as _
 
 from metadata.metadata_sites import get_navigator_audit_log_dir, get_navigator_audit_max_file_size
 
+from desktop import appmanager
 from desktop.redaction.engine import parse_redaction_policy_from_file
 from desktop.lib.conf import Config, ConfigSection, UnspecifiedConfigSection,\
                              coerce_bool, coerce_csv, coerce_json_dict,\
@@ -44,6 +45,10 @@ from desktop.lib.paths import get_desktop_root
 LOG = logging.getLogger(__name__)
 
 
+def is_oozie_enabled():
+  """Oozie needs to be available as it is the backend."""
+  return len([app for app in appmanager.DESKTOP_MODULES if app.name == 'oozie']) > 0 and is_hue4()
+
 def coerce_database(database):
   if database == 'mysql':
     return 'django.db.backends.mysql'

+ 1 - 6
desktop/libs/notebook/src/notebook/conf.py

@@ -24,16 +24,11 @@ from django.utils.translation import ugettext_lazy as _t
 
 
 from desktop import appmanager
-from desktop.conf import is_hue4
+from desktop.conf import is_hue4, is_oozie_enabled
 from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection,\
   coerce_json_dict, coerce_bool, coerce_csv
 
 
-def is_oozie_enabled():
-  """Oozie needs to be available as it is the backend."""
-  return len([app for app in appmanager.DESKTOP_MODULES if app.name == 'oozie']) > 0 and is_hue4()
-
-
 SHOW_NOTEBOOKS = Config(
     key="show_notebooks",
     help=_t("Show the notebook menu or not"),