Explorar el Código

HUE-8348 [sqoop] Disable Sqoop v2 by default

Sqoop v1 in the importer is the recommended Sqoop, e.g. http://gethue.com/importing-data-from-traditional-databases-into-hdfshive-in-just-a-few-clicks/
Sqoop v2 was deprecated.
Romain Rigaux hace 7 años
padre
commit
47b0a8c1c1

+ 7 - 0
apps/sqoop/src/sqoop/conf.py

@@ -21,6 +21,7 @@ from django.utils.translation import ugettext_lazy as _t
 
 from desktop.conf import default_ssl_validate
 from desktop.lib.conf import Config, coerce_bool
+
 from sqoop.settings import NICE_NAME
 
 
@@ -41,6 +42,12 @@ SSL_CERT_CA_VERIFY = Config(
   type=coerce_bool
 )
 
+IS_ENABLED = Config(
+    key="is_enabled",
+    help=_t("If the Sqoop2 app is enabled. Sqoop2 project is deprecated. Sqoop1 is recommended."),
+    type=coerce_bool,
+    default=False
+)
 
 def config_validator(user):
   res = []

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

@@ -1221,7 +1221,8 @@
 ###########################################################################
 
 [sqoop]
-  # For autocompletion, fill out the librdbms section.
+  # If the Sqoop2 app is enabled. Sqoop2 project is deprecated. Sqoop1 is recommended.
+  ## is_enabled=false
 
   # Sqoop server URL
   ## server_url=http://localhost:12000/sqoop
@@ -1232,6 +1233,7 @@
   # Choose whether Hue should validate certificates received from the server.
   ## ssl_cert_ca_verify=true
 
+  # For autocompletion, fill out the librdbms section.
 
 ###########################################################################
 # Settings to configure Proxy

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

@@ -1223,7 +1223,8 @@
 ###########################################################################
 
 [sqoop]
-  # For autocompletion, fill out the librdbms section.
+  # If the Sqoop2 app is enabled. Sqoop2 project is deprecated. Sqoop1 is recommended.
+  ## is_enabled=false
 
   # Sqoop server URL
   ## server_url=http://localhost:12000/sqoop
@@ -1234,6 +1235,7 @@
   # Choose whether Hue should validate certificates received from the server.
   ## ssl_cert_ca_verify=true
 
+  # For autocompletion, fill out the librdbms section.
 
 ###########################################################################
 # Settings to configure Proxy

+ 9 - 7
desktop/core/src/desktop/models.py

@@ -1820,13 +1820,15 @@ class ClusterConfig():
       })
 
     if 'sqoop' in self.apps and self.cluster_type != ANALYTIC_DB:
-      interpreters.append({
-        'type': 'sqoop',
-        'displayName': _('Sqoop'),
-        'buttonName': _('Browse'),
-        'tooltip': _('Sqoop'),
-        'page': '/sqoop'
-      })
+      from sqoop.conf import IS_ENABLED
+      if IS_ENABLED.get():
+        interpreters.append({
+          'type': 'sqoop',
+          'displayName': _('Sqoop'),
+          'buttonName': _('Browse'),
+          'tooltip': _('Sqoop'),
+          'page': '/sqoop'
+        })
 
     if interpreters:
       return {

+ 1 - 1
desktop/libs/dashboard/src/dashboard/conf.py

@@ -19,8 +19,8 @@ from django.utils.translation import ugettext as _, ugettext_lazy as _t
 
 from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection, coerce_bool
 from desktop.appmanager import get_apps_dict
-from notebook.conf import get_ordered_interpreters
 
+from notebook.conf import get_ordered_interpreters
 
 
 def is_enabled():