From d2c5bd1b0e67aec127b7871a15daf4f4c2ef133b Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Fri, 15 May 2015 11:54:23 +1200 Subject: [PATCH] Log with info instead of warn when collector not configured Users who are debugging unrelated issues are frequently interpreting logged warnings as an indication that os-collect-config is misconfigured when the warning is actually harmless. This change uses info instead of warn for this logging. Change-Id: I28e0fb37b603364eea72cdc5299a29259489b820 Closes-Bug: #1437952 --- os_collect_config/cfn.py | 8 ++++---- os_collect_config/heat.py | 12 ++++++------ os_collect_config/heat_local.py | 2 +- os_collect_config/request.py | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/os_collect_config/cfn.py b/os_collect_config/cfn.py index 4567659..acea389 100644 --- a/os_collect_config/cfn.py +++ b/os_collect_config/cfn.py @@ -66,20 +66,20 @@ class Collector(object): with open(CONF.cfn.heat_metadata_hint) as hint: CONF.cfn.metadata_url = '%s/v1/' % hint.read().strip() else: - logger.warn('No metadata_url configured.') + logger.info('No metadata_url configured.') raise exc.CfnMetadataNotConfigured if CONF.cfn.access_key_id is None: - logger.warn('No Access Key ID configured.') + logger.info('No Access Key ID configured.') raise exc.CfnMetadataNotConfigured if CONF.cfn.secret_access_key is None: - logger.warn('No Secret Access Key configured.') + logger.info('No Secret Access Key configured.') raise exc.CfnMetadataNotConfigured url = CONF.cfn.metadata_url stack_name = CONF.cfn.stack_name headers = {'Content-Type': 'application/json'} final_content = {} if CONF.cfn.path is None: - logger.warn('No path configured') + logger.info('No path configured') raise exc.CfnMetadataNotConfigured signer = ec2_utils.Ec2Signer(secret_key=CONF.cfn.secret_access_key) diff --git a/os_collect_config/heat.py b/os_collect_config/heat.py index f003104..05c42ee 100644 --- a/os_collect_config/heat.py +++ b/os_collect_config/heat.py @@ -49,22 +49,22 @@ class Collector(object): def collect(self): if CONF.heat.auth_url is None: - logger.warn('No auth_url configured.') + logger.info('No auth_url configured.') raise exc.HeatMetadataNotConfigured if CONF.heat.password is None: - logger.warn('No password configured.') + logger.info('No password configured.') raise exc.HeatMetadataNotConfigured if CONF.heat.project_id is None: - logger.warn('No project_id configured.') + logger.info('No project_id configured.') raise exc.HeatMetadataNotConfigured if CONF.heat.user_id is None: - logger.warn('No user_id configured.') + logger.info('No user_id configured.') raise exc.HeatMetadataNotConfigured if CONF.heat.stack_id is None: - logger.warn('No stack_id configured.') + logger.info('No stack_id configured.') raise exc.HeatMetadataNotConfigured if CONF.heat.resource_name is None: - logger.warn('No resource_name configured.') + logger.info('No resource_name configured.') raise exc.HeatMetadataNotConfigured try: diff --git a/os_collect_config/heat_local.py b/os_collect_config/heat_local.py index 06981fd..fee7136 100644 --- a/os_collect_config/heat_local.py +++ b/os_collect_config/heat_local.py @@ -52,7 +52,7 @@ class Collector(object): else: final_content = value if not final_content: - logger.warn('Local metadata not found (%s)' % + logger.info('Local metadata not found (%s)' % cfg.CONF.heat_local.path) raise exc.HeatLocalMetadataNotAvailable return [('heat_local', final_content)] diff --git a/os_collect_config/request.py b/os_collect_config/request.py index 5910ee4..61e3edf 100644 --- a/os_collect_config/request.py +++ b/os_collect_config/request.py @@ -66,7 +66,7 @@ class Collector(object): def collect(self): if CONF.request.metadata_url is None: - logger.warn('No metadata_url configured.') + logger.info('No metadata_url configured.') raise exc.RequestMetadataNotConfigured url = CONF.request.metadata_url final_content = {}