Replace deprecated LOG.warn with LOG.warning

LOG.warn is deprecated. It still used in a few places.
Updated to non-deprecated LOG.warning.

Change-Id: I00d4afb7f0b3a4c0449a71d8a3795fed90e12844
Closes-Bug:#1508442
This commit is contained in:
Swapnil Kulkarni (coolsvap) 2016-01-05 13:45:32 +05:30
parent 7dcb033d5b
commit 05ddc5622b
7 changed files with 15 additions and 14 deletions

View File

@ -152,8 +152,8 @@ class AuthInformationHook(hooks.PecanHook):
# Fallback to deprecated role header:
roles = req.headers.get('X-Role', '')
if roles:
LOG.warn(_("X-Roles is missing. Using deprecated X-Role "
"header"))
LOG.warning(_("X-Roles is missing. Using deprecated X-Role "
"header"))
return [r.strip() for r in roles.split(',')]

View File

@ -101,7 +101,7 @@ class AppHandler(handler.Handler):
self.context.user_name = app_obj.trust_user
except exception.AuthorizationFailure as auth_ex:
LOG.warn(auth_ex)
LOG.warning(auth_ex)
return
# TODO(devkulkarni): Call repo_utils.verify_artifact

View File

@ -68,7 +68,7 @@ class AssemblyHandler(handler.Handler):
self.context = keystone_utils.create_delegation_context(
db_obj, self.context)
except exception.AuthorizationFailure as auth_ex:
LOG.warn(auth_ex)
LOG.warning(auth_ex)
return
plan_obj = objects.registry.Plan.get_by_id(self.context,

View File

@ -59,7 +59,7 @@ class PipelineHandler(handler.Handler):
try:
self.context = self._context_from_trust_id(db_obj.trust_id)
except exception.AuthorizationFailure as auth_ex:
LOG.warn(auth_ex)
LOG.warning(auth_ex)
return
self._execute_workbook(db_obj)

View File

@ -191,7 +191,7 @@ class PlanHandler(handler.Handler):
self.context.user_name = plan_obj.username
except exception.AuthorizationFailure as auth_ex:
LOG.warn(auth_ex)
LOG.warning(auth_ex)
return
artifacts = plan_obj.raw_content.get('artifacts', [])

View File

@ -78,8 +78,9 @@ def send_status(test_result, status_url, repo_token, pending=False):
"status_url %s, repo_token %s" %
(resp['status'], status_url, repo_token))
except (httplib2.HttpLib2Error, socket.error) as ex:
LOG.warn("Error in sending status, status url: %s, repo token: %s,"
" error: %s" % (status_url, repo_token, ex))
LOG.warning(
"Error in sending status, status url: %s, repo token: %s,"
" error: %s" % (status_url, repo_token, ex))
else:
LOG.debug("No url or token available to send back status")
@ -104,6 +105,6 @@ def verify_artifact(artifact, collab_url):
reason="User %s not allowed to do rebuild" %
collab_url.split('/')[-1])
except (httplib2.HttpLib2Error, socket.error) as ex:
LOG.warn("Error in verifying collaborator, collab url: %s,"
" error: %s" % (collab_url, ex))
LOG.warning("Error in verifying collaborator, collab url: %s,"
" error: %s" % (collab_url, ex))
return False

View File

@ -372,8 +372,8 @@ class Handler(object):
if (not image or not image.project_id or not image.status or
not image.external_ref or not image.docker_image_name or
image.status.lower() != 'ready'):
LOG.warn("Error building due to language pack not ready."
" assembly ID: %s" % assembly_id)
LOG.warning("Error building due to language pack not ready."
" assembly ID: %s" % assembly_id)
job_update_notification(ctxt, build_id, IMAGE_STATES.ERROR,
description='language pack not ready',
assembly_id=assembly_id)
@ -500,8 +500,8 @@ class Handler(object):
if (not image or not image.project_id or not image.status or
not image.external_ref or not image.docker_image_name or
image.status.lower() != 'ready'):
LOG.warn("Error running unittest due to language pack"
" not ready. assembly ID: %s" % assembly_id)
LOG.warning("Error running unittest due to language pack"
" not ready. assembly ID: %s" % assembly_id)
update_assembly_status(ctxt, assembly_id,
ASSEMBLY_STATES.ERROR)
return