Merge "Using LOG.warning replace LOG.warn"

This commit is contained in:
Jenkins 2016-01-05 20:03:04 +00:00 committed by Gerrit Code Review
commit 30ffb4f8da
6 changed files with 20 additions and 20 deletions

View File

@ -77,7 +77,7 @@ def _retrieve_project_list_from_gerrit(project_source):
gerrit_inst.close()
except Exception as e:
LOG.exception(e)
LOG.warn('Fail to retrieve list of projects. Keep it unmodified')
LOG.warning('Fail to retrieve list of projects. Keep it unmodified')
return
organization = project_source['organization']
@ -109,7 +109,7 @@ def _retrieve_project_list_from_github(project_source):
github_repos = github.get_organization(organization).get_repos()
except Exception as e:
LOG.exception(e)
LOG.warn('Fail to retrieve list of projects. Keep it unmodified')
LOG.warning('Fail to retrieve list of projects. Keep it unmodified')
return
for repo in github_repos:
@ -160,7 +160,7 @@ def _update_with_driverlog_data(default_data, driverlog_data_uri):
driverlog_data = utils.read_json_from_uri(driverlog_data_uri)
if not driverlog_data:
LOG.warn('DriverLog data is not available')
LOG.warning('DriverLog data is not available')
return
module_cis = collections.defaultdict(list)

View File

@ -69,7 +69,7 @@ def lp_blueprint_generator(module):
chunk = utils.read_json_from_uri(uri, session=launchpad_session)
if not chunk:
LOG.warn('No data was read from uri %s', uri)
LOG.warning('No data was read from uri %s', uri)
break
for record in chunk['entries']:
@ -90,7 +90,7 @@ def lp_bug_generator(module, modified_since):
chunk = utils.read_json_from_uri(uri, session=launchpad_session)
if not chunk:
LOG.warn('No data was read from uri %s', uri)
LOG.warning('No data was read from uri %s', uri)
break
for record in chunk['entries']:
@ -101,7 +101,7 @@ def lp_bug_generator(module, modified_since):
related_tasks = utils.read_json_from_uri(related_tasks_uri,
session=launchpad_session)
if not related_tasks:
LOG.warn('No data was read from uri %s', uri)
LOG.warning('No data was read from uri %s', uri)
elif related_tasks['entries']:
for related_task in related_tasks['entries']:
yield related_task

View File

@ -242,7 +242,7 @@ def apply_corrections(uri, runtime_storage_inst):
if 'primary_key' in c:
valid_corrections.append(c)
else:
LOG.warn('Correction misses primary key: %s', c)
LOG.warning('Correction misses primary key: %s', c)
runtime_storage_inst.apply_corrections(valid_corrections)

View File

@ -45,9 +45,9 @@ class RecordProcessor(object):
def _get_release(self, timestamp):
release_index = bisect.bisect(self.releases_dates, timestamp)
if release_index >= len(self.releases):
LOG.warn('Timestamp %s is beyond releases boundaries, the last '
'release will be used. Please consider adding a '
'new release into default_data.json', timestamp)
LOG.warning('Timestamp %s is beyond releases boundaries, the last '
'release will be used. Please consider adding a '
'new release into default_data.json', timestamp)
release_index = len(self.releases) - 1
return self.releases[release_index]['release_name']

View File

@ -137,16 +137,16 @@ def read_uri(uri, session=None):
try:
return do_request(uri, session=session).text
except Exception as e:
LOG.warn('Error "%(error)s" retrieving uri %(uri)s',
{'error': e, 'uri': uri})
LOG.warning('Error "%(error)s" retrieving uri %(uri)s',
{'error': e, 'uri': uri})
def read_json_from_uri(uri, session=None):
try:
return do_request(uri, session=session).json()
except Exception as e:
LOG.warn('Error "%(error)s" parsing json from uri %(uri)s',
{'error': e, 'uri': uri})
LOG.warning('Error "%(error)s" parsing json from uri %(uri)s',
{'error': e, 'uri': uri})
def _gzip_decompress(content):
@ -161,16 +161,16 @@ def read_gzip_from_uri(uri):
try:
return _gzip_decompress(do_request(uri).content)
except Exception as e:
LOG.warn('Error "%(error)s" retrieving uri %(uri)s',
{'error': e, 'uri': uri})
LOG.warning('Error "%(error)s" retrieving uri %(uri)s',
{'error': e, 'uri': uri})
def get_uri_last_modified(uri):
try:
return do_request(uri, method='head').headers['last-modified']
except Exception as e:
LOG.warn('Error "%(error)s" retrieving uri %(uri)s',
{'error': e, 'uri': uri})
LOG.warning('Error "%(error)s" retrieving uri %(uri)s',
{'error': e, 'uri': uri})
def cmp_to_key(mycmp): # ported from python 3

View File

@ -121,8 +121,8 @@ class Git(Vcs):
return {}
if uri != self.repo['uri']:
LOG.warn('Repo uri %(uri)s differs from cloned %(old)s',
{'uri': self.repo['uri'], 'old': uri})
LOG.warning('Repo uri %(uri)s differs from cloned %(old)s',
{'uri': self.repo['uri'], 'old': uri})
os.chdir('..')
shutil.rmtree(self.folder)