Browse Source

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
changes/60/183360/1
Steve Baker 6 years ago
parent
commit
d2c5bd1b0e
  1. 8
      os_collect_config/cfn.py
  2. 12
      os_collect_config/heat.py
  3. 2
      os_collect_config/heat_local.py
  4. 2
      os_collect_config/request.py

8
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)

12
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:

2
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)]

2
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 = {}

Loading…
Cancel
Save