Merge "Using LOG.warning replace LOG.warn"
This commit is contained in:
commit
30ffb4f8da
@ -77,7 +77,7 @@ def _retrieve_project_list_from_gerrit(project_source):
|
|||||||
gerrit_inst.close()
|
gerrit_inst.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(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
|
return
|
||||||
|
|
||||||
organization = project_source['organization']
|
organization = project_source['organization']
|
||||||
@ -109,7 +109,7 @@ def _retrieve_project_list_from_github(project_source):
|
|||||||
github_repos = github.get_organization(organization).get_repos()
|
github_repos = github.get_organization(organization).get_repos()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(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
|
return
|
||||||
|
|
||||||
for repo in github_repos:
|
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)
|
driverlog_data = utils.read_json_from_uri(driverlog_data_uri)
|
||||||
|
|
||||||
if not driverlog_data:
|
if not driverlog_data:
|
||||||
LOG.warn('DriverLog data is not available')
|
LOG.warning('DriverLog data is not available')
|
||||||
return
|
return
|
||||||
|
|
||||||
module_cis = collections.defaultdict(list)
|
module_cis = collections.defaultdict(list)
|
||||||
|
@ -69,7 +69,7 @@ def lp_blueprint_generator(module):
|
|||||||
chunk = utils.read_json_from_uri(uri, session=launchpad_session)
|
chunk = utils.read_json_from_uri(uri, session=launchpad_session)
|
||||||
|
|
||||||
if not chunk:
|
if not chunk:
|
||||||
LOG.warn('No data was read from uri %s', uri)
|
LOG.warning('No data was read from uri %s', uri)
|
||||||
break
|
break
|
||||||
|
|
||||||
for record in chunk['entries']:
|
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)
|
chunk = utils.read_json_from_uri(uri, session=launchpad_session)
|
||||||
|
|
||||||
if not chunk:
|
if not chunk:
|
||||||
LOG.warn('No data was read from uri %s', uri)
|
LOG.warning('No data was read from uri %s', uri)
|
||||||
break
|
break
|
||||||
|
|
||||||
for record in chunk['entries']:
|
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,
|
related_tasks = utils.read_json_from_uri(related_tasks_uri,
|
||||||
session=launchpad_session)
|
session=launchpad_session)
|
||||||
if not related_tasks:
|
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']:
|
elif related_tasks['entries']:
|
||||||
for related_task in related_tasks['entries']:
|
for related_task in related_tasks['entries']:
|
||||||
yield related_task
|
yield related_task
|
||||||
|
@ -242,7 +242,7 @@ def apply_corrections(uri, runtime_storage_inst):
|
|||||||
if 'primary_key' in c:
|
if 'primary_key' in c:
|
||||||
valid_corrections.append(c)
|
valid_corrections.append(c)
|
||||||
else:
|
else:
|
||||||
LOG.warn('Correction misses primary key: %s', c)
|
LOG.warning('Correction misses primary key: %s', c)
|
||||||
runtime_storage_inst.apply_corrections(valid_corrections)
|
runtime_storage_inst.apply_corrections(valid_corrections)
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,9 +45,9 @@ class RecordProcessor(object):
|
|||||||
def _get_release(self, timestamp):
|
def _get_release(self, timestamp):
|
||||||
release_index = bisect.bisect(self.releases_dates, timestamp)
|
release_index = bisect.bisect(self.releases_dates, timestamp)
|
||||||
if release_index >= len(self.releases):
|
if release_index >= len(self.releases):
|
||||||
LOG.warn('Timestamp %s is beyond releases boundaries, the last '
|
LOG.warning('Timestamp %s is beyond releases boundaries, the last '
|
||||||
'release will be used. Please consider adding a '
|
'release will be used. Please consider adding a '
|
||||||
'new release into default_data.json', timestamp)
|
'new release into default_data.json', timestamp)
|
||||||
release_index = len(self.releases) - 1
|
release_index = len(self.releases) - 1
|
||||||
return self.releases[release_index]['release_name']
|
return self.releases[release_index]['release_name']
|
||||||
|
|
||||||
|
@ -137,16 +137,16 @@ def read_uri(uri, session=None):
|
|||||||
try:
|
try:
|
||||||
return do_request(uri, session=session).text
|
return do_request(uri, session=session).text
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.warn('Error "%(error)s" retrieving uri %(uri)s',
|
LOG.warning('Error "%(error)s" retrieving uri %(uri)s',
|
||||||
{'error': e, 'uri': uri})
|
{'error': e, 'uri': uri})
|
||||||
|
|
||||||
|
|
||||||
def read_json_from_uri(uri, session=None):
|
def read_json_from_uri(uri, session=None):
|
||||||
try:
|
try:
|
||||||
return do_request(uri, session=session).json()
|
return do_request(uri, session=session).json()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.warn('Error "%(error)s" parsing json from uri %(uri)s',
|
LOG.warning('Error "%(error)s" parsing json from uri %(uri)s',
|
||||||
{'error': e, 'uri': uri})
|
{'error': e, 'uri': uri})
|
||||||
|
|
||||||
|
|
||||||
def _gzip_decompress(content):
|
def _gzip_decompress(content):
|
||||||
@ -161,16 +161,16 @@ def read_gzip_from_uri(uri):
|
|||||||
try:
|
try:
|
||||||
return _gzip_decompress(do_request(uri).content)
|
return _gzip_decompress(do_request(uri).content)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.warn('Error "%(error)s" retrieving uri %(uri)s',
|
LOG.warning('Error "%(error)s" retrieving uri %(uri)s',
|
||||||
{'error': e, 'uri': uri})
|
{'error': e, 'uri': uri})
|
||||||
|
|
||||||
|
|
||||||
def get_uri_last_modified(uri):
|
def get_uri_last_modified(uri):
|
||||||
try:
|
try:
|
||||||
return do_request(uri, method='head').headers['last-modified']
|
return do_request(uri, method='head').headers['last-modified']
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.warn('Error "%(error)s" retrieving uri %(uri)s',
|
LOG.warning('Error "%(error)s" retrieving uri %(uri)s',
|
||||||
{'error': e, 'uri': uri})
|
{'error': e, 'uri': uri})
|
||||||
|
|
||||||
|
|
||||||
def cmp_to_key(mycmp): # ported from python 3
|
def cmp_to_key(mycmp): # ported from python 3
|
||||||
|
@ -121,8 +121,8 @@ class Git(Vcs):
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
if uri != self.repo['uri']:
|
if uri != self.repo['uri']:
|
||||||
LOG.warn('Repo uri %(uri)s differs from cloned %(old)s',
|
LOG.warning('Repo uri %(uri)s differs from cloned %(old)s',
|
||||||
{'uri': self.repo['uri'], 'old': uri})
|
{'uri': self.repo['uri'], 'old': uri})
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
shutil.rmtree(self.folder)
|
shutil.rmtree(self.folder)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user