Forráskód Böngészése

[core] Avoid django.core.exceptions.AppRegistryNotReady when hdfs off

Romain Rigaux 4 éve
szülő
commit
2bfe50ddce

+ 2 - 2
desktop/core/src/desktop/lib/idbroker/conf.py

@@ -19,7 +19,7 @@ import logging
 
 from hadoop.core_site import get_conf
 
-from django.utils.translation import ugettext as _
+from django.utils.translation import ugettext_lazy as _t
 
 LOG = logging.getLogger(__name__)
 
@@ -72,6 +72,6 @@ def config_validator():
         raise ValueError('Failed to obtain IDBroker Token')
     except Exception as e:
       LOG.exception('Failed to obtain IDBroker Token')
-      res.append(('idbroker', _('Failed to obtain IDBroker Token, check your IDBroker configuration.')))
+      res.append(('idbroker', _t('Failed to obtain IDBroker Token, check your IDBroker configuration.')))
 
   return res

+ 1 - 1
desktop/core/src/desktop/lib/paths.py

@@ -91,7 +91,7 @@ def get_run_root(*append):
 
 def get_hadoop_conf_dir_default_config():
   from hadoop.conf import HDFS_CLUSTERS, get_hadoop_conf_dir_default
-  if list(HDFS_CLUSTERS.keys()):
+  if list(HDFS_CLUSTERS.keys()) and HDFS_CLUSTERS[list(HDFS_CLUSTERS.keys())[0]].IS_ENABLED.get():
     yarn_site_path = HDFS_CLUSTERS[list(HDFS_CLUSTERS.keys())[0]].HADOOP_CONF_DIR.get()
   else:
     yarn_site_path = get_hadoop_conf_dir_default()

+ 3 - 3
desktop/libs/azure/src/azure/conf.py

@@ -17,7 +17,7 @@ from __future__ import absolute_import
 
 import logging
 
-from django.utils.translation import ugettext_lazy as _, ugettext as _t
+from django.utils.translation import ugettext_lazy as _t
 
 from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection, coerce_password_from_script
 from desktop.lib.idbroker import conf as conf_idbroker
@@ -115,7 +115,7 @@ AZURE_ACCOUNTS = UnspecifiedConfigSection(
         type=coerce_password_from_script,
         default=None,
         private=True,
-        help=_("Execute this script to produce the ADLS client secret.")),
+        help=_t("Execute this script to produce the ADLS client secret.")),
       TENANT_ID=Config(
         key="tenant_id",
         type=str,
@@ -126,7 +126,7 @@ AZURE_ACCOUNTS = UnspecifiedConfigSection(
         type=coerce_password_from_script,
         default=None,
         private=True,
-        help=_("Execute this script to produce the ADLS tenant id.")),
+        help=_t("Execute this script to produce the ADLS tenant id.")),
     )
   )
 )

+ 3 - 2
desktop/libs/hadoop/src/hadoop/conf.py

@@ -121,8 +121,9 @@ HDFS_CLUSTERS = UnspecifiedConfigSection(
           key="hadoop_conf_dir",
           dynamic_default=get_hadoop_conf_dir_default,
           help=
-            "Directory of the Hadoop configuration) Defaults to the environment variable HADOOP_CONF_DIR when set, "
-            "or '/etc/hadoop/conf'."
+            "Directory of the Hadoop configuration. Defaults to the environment variable HADOOP_CONF_DIR when set, "
+            "or '/etc/hadoop/conf'.",
+          type=str
       ),
       IS_ENABLED=Config(
           'is_enabled',

+ 4 - 2
tools/docker/hue/conf3/z-hue-overrides.ini

@@ -189,21 +189,23 @@ has_sql_enabled=true
 # HA support by using HttpFs
 
 # [[[default]]]
+
 # Enter the filesystem uri
-# fs_defaultfs=hdfs://localhost:8020
+## fs_defaultfs=hdfs://localhost:8020
 
 # Use WebHdfs/HttpFs as the communication mechanism.
 # Domain should be the NameNode or HttpFs host.
 # Default port is 14000 for HttpFs.
 ## webhdfs_url=http://localhost:50070/webhdfs/v1
 
-is_enabled=false
+## is_enabled=false
 
 # Configuration for YARN (MR2)
 # ------------------------------------------------------------------------
 [[yarn_clusters]]
 
 # [[[default]]]
+
 # Enter the host on which you are running the ResourceManager
 ## resourcemanager_host=localhost