This is an automated email from the ASF dual-hosted git repository. adoroszlai pushed a commit to branch branch-feature-AMBARI-14714 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by this push: new f835be6 AMBARI-22649. Avoid using uninitialized logger, reduce verbosity (#536) f835be6 is described below commit f835be64ee617d75529ad65229de19b7e049999e Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com> AuthorDate: Sat Mar 10 09:27:24 2018 +0100 AMBARI-22649. Avoid using uninitialized logger, reduce verbosity (#536) --- ambari-common/src/main/python/resource_management/core/logger.py | 3 ++- .../python/resource_management/libraries/functions/settings.py | 8 ++++---- .../resource_management/libraries/functions/stack_features.py | 2 +- .../resource_management/libraries/functions/stack_select.py | 2 +- .../python/resource_management/libraries/functions/stack_tools.py | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ambari-common/src/main/python/resource_management/core/logger.py b/ambari-common/src/main/python/resource_management/core/logger.py index d83e61d..0288c02 100644 --- a/ambari-common/src/main/python/resource_management/core/logger.py +++ b/ambari-common/src/main/python/resource_management/core/logger.py @@ -76,7 +76,8 @@ class Logger: @staticmethod def debug(text): - Logger.logger.debug(Logger.filter_text(text)) + if Logger.logger: + Logger.logger.debug(Logger.filter_text(text)) @staticmethod def error_resource(resource): diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/settings.py b/ambari-common/src/main/python/resource_management/libraries/functions/settings.py index 577e5ba..628deb8 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/settings.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/settings.py @@ -42,7 +42,7 @@ def get_setting_type_entries(setting_type, setting_names=None): """ from resource_management.libraries.functions.default import default - Logger.info("In get_setting_type_entries(). Passed-in settings type : {0}, setting(s) : {1}".format(setting_type, setting_names)) + Logger.debug("In get_setting_type_entries(). Passed-in settings type : {0}, setting(s) : {1}".format(setting_type, setting_names)) if not is_setting_type_supported(setting_type): Logger.error("Does not support retrieving settings for settings_type : {0}".format(setting_type)) @@ -51,7 +51,7 @@ def get_setting_type_entries(setting_type, setting_names=None): settings = default(setting_type, None) if settings is None: - Logger.info("Couldn't retrieve '"+setting_type+"'.") + Logger.debug("Couldn't retrieve '"+setting_type+"'.") return None if setting_names is None: # Return all settings @@ -85,7 +85,7 @@ def get_setting_value(setting_type, setting_name): """ from resource_management.libraries.functions.default import default - Logger.info("In get_setting_value(). Passed-in settings type : {0}, setting(s) : {1}".format(setting_type, setting_name)) + Logger.debug("In get_setting_value(). Passed-in settings type : {0}, setting(s) : {1}".format(setting_type, setting_name)) if not is_setting_type_supported(setting_type): Logger.error("Does not support retrieving settings for settings_type : {0}".format(setting_type)) @@ -97,7 +97,7 @@ def get_setting_value(setting_type, setting_name): settings = default(setting_type, None) if settings is None: - Logger.info("Couldn't retrieve '"+setting_type+"'.") + Logger.debug("Couldn't retrieve '"+setting_type+"'.") return None return convert_value(settings.get(setting_name)) diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py b/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py index 92a8383..963f3a1 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py @@ -54,7 +54,7 @@ def check_stack_feature(stack_feature, stack_version): # TODO : Removed the below if of reading from cluster_env, once we have removed stack_features from there # and have started using /stackSettings as source of truth. if stack_features_setting is None: - Logger.info("Couldn't retrieve 'stack_features' from /stackSettings. Retrieving from cluster_env now.") + Logger.debug("Couldn't retrieve 'stack_features' from /stackSettings. Retrieving from cluster_env now.") stack_features_setting = default("/configurations/cluster-env/"+stack_settings.STACK_FEATURES_SETTING, None) diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py index a3f086d..75184b2 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py @@ -192,7 +192,7 @@ def get_packages(scope, service_name = None, component_name = None): # TODO : Removed the below if of reading from cluster_env, once we have removed stack_packages from there # and have started using /stackSettings as source of truth. if stack_packages_setting is None: - Logger.info("Couldn't retrieve 'stack_packages' from /stackSettings. Retrieving from cluster_env now.") + Logger.debug("Couldn't retrieve 'stack_packages' from /stackSettings. Retrieving from cluster_env now.") stack_packages_setting = default("/configurations/cluster-env/"+stack_settings.STACK_PACKAGES_SETTING, None) if stack_packages_setting is None: diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/stack_tools.py b/ambari-common/src/main/python/resource_management/libraries/functions/stack_tools.py index 997cf28..9bb0781 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/stack_tools.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/stack_tools.py @@ -50,7 +50,7 @@ def get_stack_tool(name): # TODO : Removed the below if of reading from cluster_env, once we have removed stack_tools from there # and have started using /stackSettings as source of truth. if stack_tools_setting is None: - Logger.info("Couldn't retrieve 'stack_tools' from /stackSettings. Retrieving from cluster_env now.") + Logger.debug("Couldn't retrieve 'stack_tools' from /stackSettings. Retrieving from cluster_env now.") stack_tools_setting = default("/configurations/cluster-env/"+stack_settings.STACK_TOOLS_SETTING, None) if stack_tools_setting: -- To stop receiving notification emails like this one, please contact adorosz...@apache.org.