Browse Source

[config] Change config type from bool to coerce_bool (#2836)

- This removes coerce_bool usage warning when server starts
Harsh Gupta 3 years ago
parent
commit
dc301dbc75
2 changed files with 11 additions and 11 deletions
  1. 2 2
      desktop/libs/azure/src/azure/conf.py
  2. 9 9
      desktop/libs/indexer/src/indexer/conf.py

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

@@ -18,7 +18,7 @@ from __future__ import absolute_import
 import logging
 import sys
 
-from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection, coerce_password_from_script
+from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection, coerce_password_from_script, coerce_bool
 from desktop.lib.idbroker import conf as conf_idbroker
 
 from hadoop import core_site
@@ -146,7 +146,7 @@ ABFS_CLUSTERS = UnspecifiedConfigSection(
     members=dict(
       ENABLE_DEFAULTFS_FROM_CORESITE=Config(
         key="enable_defaultfs_from_coresite",
-        type=bool,
+        type=coerce_bool,
         default=True,
         help="Enable this param to use the defaultFS from core-site.xml"),
       FS_DEFAULTFS=Config("fs_defaultfs", help="abfs://<container_name>@<account_name>.dfs.core.windows.net", type=str, default=None),

+ 9 - 9
desktop/libs/indexer/src/indexer/conf.py

@@ -21,7 +21,7 @@ import logging
 import os
 import sys
 
-from desktop.lib.conf import Config
+from desktop.lib.conf import Config, coerce_bool
 from libsolr import conf as libsolr_conf
 from libzookeeper import conf as libzookeeper_conf
 
@@ -77,14 +77,14 @@ def zkensemble():
 ENABLE_NEW_INDEXER = Config(
   key="enable_new_indexer",
   help=_t("Flag to turn on the new Solr indexer."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )
 
 ENABLE_SCALABLE_INDEXER = Config(
   key="enable_scalable_indexer",
   help=_t("Flag to turn on the Morphline Solr indexer."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )
 
@@ -112,42 +112,42 @@ CONFIG_JARS_LIBS_PATH = Config(
 ENABLE_SQOOP = Config(
   key="enable_sqoop",
   help=_t("Flag to turn on Sqoop imports."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )
 
 ENABLE_KAFKA = Config(
   key="enable_kafka",
   help=_t("Flag to turn on Kafka imports."),
-  type=bool,
+  type=coerce_bool,
   default=False
 )
 
 ENABLE_FIELD_EDITOR = Config(
   key="enable_field_editor",
   help=_t("Flag to turn on the SQL/Morphline field editor."),
-  type=bool,
+  type=coerce_bool,
   default=False
 )
 
 ENABLE_ENVELOPE = Config(
   key="enable_envelope",
   help=_t("Flag to turn on Envelope based jobs."),
-  type=bool,
+  type=coerce_bool,
   default=False
 )
 
 ENABLE_ALTUS = Config(
   key="enable_altus",
   help=_t("Flag to turn on Altus imports."),
-  type=bool,
+  type=coerce_bool,
   default=False
 )
 
 ENABLE_DIRECT_UPLOAD = Config(
   key="enable_direct_upload",
   help=_t("Flag to turn on the direct upload of a small file."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )