Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Merge "Replace deprecated LOG.warn with LOG.warning"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Apr 6, 2016
2 parents 488cd14 + 66e9415 commit 25a68c2
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 76 deletions.
16 changes: 9 additions & 7 deletions poppy/distributed_task/taskflow/task/create_service_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ def revert(self, responders, retry_sleep_time,
self.retry_progress = current_progress
self.retry_index = 1
if self.retry_progress == 1.0:
LOG.warn('Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warn('Setting of state of service_id: '
'{0} and project_id: {1} '
'to failed'.format(service_id, project_id))
LOG.warning(
'Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warning(
'Setting of state of service_id: '
'{0} and project_id: {1} '
'to failed'.format(service_id, project_id))
provider_details_dict = {}
result = kwargs['result']

Expand Down Expand Up @@ -186,8 +188,8 @@ def revert(self, responders, retry_sleep_time,
project_id,
service_id)
else:
LOG.warn('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
LOG.warning('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
if retry_sleep_time is not None:
time.sleep(retry_sleep_time)

Expand Down
16 changes: 9 additions & 7 deletions poppy/distributed_task/taskflow/task/delete_service_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ def revert(self, provider_details, retry_sleep_time,
self.retry_progress = current_progress
self.retry_index = 1
if self.retry_progress == 1.0:
LOG.warn('Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warn('Setting of state of service_id: '
'{0} and project_id: {1} '
'to failed'.format(service_id, project_id))
LOG.warning(
'Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warning(
'Setting of state of service_id: '
'{0} and project_id: {1} '
'to failed'.format(service_id, project_id))
provider_details_dict = {}
result = kwargs['result']
for responder in responders:
Expand All @@ -153,8 +155,8 @@ def revert(self, provider_details, retry_sleep_time,
project_id,
service_id)
else:
LOG.warn('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
LOG.warning('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
if retry_sleep_time is not None:
time.sleep(retry_sleep_time)

Expand Down
76 changes: 42 additions & 34 deletions poppy/distributed_task/taskflow/task/update_service_state_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,34 @@ def revert(self, service_obj, project_id, retry_sleep_time, **kwargs):
self.retry_progress = current_progress
self.retry_index = 1
if self.retry_progress == 1.0:
LOG.warn('Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warning(
'Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
service_obj_json = json.loads(service_obj)
service_obj = service.load_from_json(service_obj_json)
LOG.warn('DNS enabling on service_id: '
'{0} and project_id: {1} '
' failed'.format(service_obj.service_id, project_id))
LOG.warning(
'DNS enabling on service_id: '
'{0} and project_id: {1} '
' failed'.format(service_obj.service_id, project_id))
result = kwargs['result']
exc_class = str(result.exc_info[0])
exc_traceback = result.traceback_str
LOG.warn('Error Class : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_class,
service_obj.service_id,
project_id))
LOG.warn('Error Traceback : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_traceback,
service_obj.service_id,
project_id))
LOG.warning(
'Error Class : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_class,
service_obj.service_id,
project_id))
LOG.warning(
'Error Traceback : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_traceback,
service_obj.service_id,
project_id))

else:
LOG.warn('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
LOG.warning('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
if retry_sleep_time is not None:
time.sleep(retry_sleep_time)

Expand Down Expand Up @@ -205,29 +209,33 @@ def revert(self, service_obj, project_id, retry_sleep_time, **kwargs):
self.retry_progress = current_progress
self.retry_index = 1
if self.retry_progress == 1.0:
LOG.warn('Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warning(
'Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
service_obj_json = json.loads(service_obj)
service_obj = service.load_from_json(service_obj_json)
LOG.warn('DNS enabling on service_id: '
'{0} and project_id: {1} '
' failed'.format(service_obj.service_id, project_id))
LOG.warning(
'DNS enabling on service_id: '
'{0} and project_id: {1} '
' failed'.format(service_obj.service_id, project_id))
result = kwargs['result']
exc_class = str(result.exc_info[0])
exc_traceback = result.traceback_str
LOG.warn('Error Class : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_class,
service_obj.service_id,
project_id))
LOG.warn('Error Traceback : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_traceback,
service_obj.service_id,
project_id))
LOG.warning(
'Error Class : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_class,
service_obj.service_id,
project_id))
LOG.warning(
'Error Traceback : {0} for '
'service_id: {1} '
'and project_id: {2}'.format(exc_traceback,
service_obj.service_id,
project_id))

else:
LOG.warn('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
LOG.warning('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
if retry_sleep_time is not None:
time.sleep(retry_sleep_time)
16 changes: 9 additions & 7 deletions poppy/distributed_task/taskflow/task/update_service_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ def revert(self, responders, retry_sleep_time,
self.retry_progress = current_progress
self.retry_index = 1
if self.retry_progress == 1.0:
LOG.warn('Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warn('Setting of state of service_id: '
'{0} and project_id: {1} '
'to failed'.format(service_id, project_id))
LOG.warning(
'Maximum retry attempts of '
'{0} reached for Task {1}'.format(retries, self.name))
LOG.warning(
'Setting of state of service_id: '
'{0} and project_id: {1} '
'to failed'.format(service_id, project_id))
provider_details_dict = {}
result = kwargs['result']

Expand Down Expand Up @@ -167,8 +169,8 @@ def revert(self, responders, retry_sleep_time,
project_id,
service_id)
else:
LOG.warn('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
LOG.warning('Sleeping for {0} seconds and '
'retrying'.format(retry_sleep_time))
if retry_sleep_time is not None:
time.sleep(retry_sleep_time)

Expand Down
8 changes: 4 additions & 4 deletions poppy/manager/default/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ def get_metrics_by_domain(self, project_id, domain_name, **extras):
except ValueError:
msg = "Domain: {0} was not found for project_id: {1}".format(
domain_name, project_id)
LOG.warn(msg)
LOG.warning(msg)
raise errors.ServiceNotFound(msg)
if not result:
msg = "Domain: {0} was not found for project_id: {1}".format(
domain_name, project_id)
LOG.warn(msg)
LOG.warning(msg)
raise errors.ServiceNotFound(msg)

if not result.provider_details:
msg = "Provider Details were None " \
"for the service_id: {0} " \
"corresponding to project_id: {1}".format(result.service_id,
project_id)
LOG.warn(msg)
LOG.warning(msg)
raise errors.ServiceProviderDetailsNotFound(msg)

provider_details_dict = result.provider_details
Expand All @@ -58,7 +58,7 @@ def get_metrics_by_domain(self, project_id, domain_name, **extras):

if not provider_for_domain:
msg = "Provider not found for Domain : {0}".format(domain_name)
LOG.warn(msg)
LOG.warning(msg)
raise errors.ProviderNotFound(msg)

provider_obj = self.providers[provider_for_domain.lower()].obj
Expand Down
12 changes: 6 additions & 6 deletions poppy/metrics/blueflood/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def _result_formatter(self, response):
resp_dict = dict()

if not response.ok:
LOG.warn("BlueFlood Metrics Response status Code:{0} "
"Response Text: {1} "
"Request URL: {2}".format(response.status_code,
response.text,
response.url))
LOG.warning("BlueFlood Metrics Response status Code:{0} "
"Response Text: {1} "
"Request URL: {2}".format(response.status_code,
response.text,
response.url))
return resp_dict
else:

Expand All @@ -53,7 +53,7 @@ def _result_formatter(self, response):
except KeyError:
msg = 'content from {0} not conforming ' \
'to API contracts'.format(response.url)
LOG.warn(msg)
LOG.warning(msg)
raise errors.BlueFloodApiSchemaError(msg)

return resp_dict
Expand Down
8 changes: 4 additions & 4 deletions poppy/provider/akamai/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ def is_alive(self):
configuration_number=self.http_conf_number,
policy_name=unique_id))
except Exception as e:
LOG.warn(
LOG.warning(
'Akamai Health Check Succeeded but \
failed to delete policy:{0}'.format(e))
return True

else:
LOG.warn("Akamai Health Check Failed")
LOG.warn("Response Status Code : {0}".format(resp.status_code))
LOG.warn("Response Text : {0}".format(resp.text))
LOG.warning("Akamai Health Check Failed")
LOG.warning("Response Status Code : {0}".format(resp.status_code))
LOG.warning("Response Text : {0}".format(resp.text))
return False

@property
Expand Down
5 changes: 3 additions & 2 deletions poppy/provider/akamai/geo_zone_code_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,13 @@
try:
raise ValueError('Unsupported region config')
except ValueError:
LOG.warn('Unsupported region: %s in GEO zone mapping' % region)
LOG.warning('Unsupported region: %s in GEO zone mapping' % region)

# validate COUNTRY_CODE_MAPPING keys are in GEO_ZONES'
for country in COUNTRY_CODE_MAPPING:
if country not in geo_zones.GEO_COUNTRY_ZONES:
try:
raise ValueError('Unsupported country config')
except ValueError:
LOG.warn('Unsupported country: %s in GEO zone mapping' % country)
LOG.warning(
'Unsupported country: %s in GEO zone mapping' % country)
10 changes: 5 additions & 5 deletions poppy/storage/cassandra/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ def domain_exists_elsewhere(self, domain_name, service_id):
"yielded no results".format(domain_name))
return False
except ValueError as ex:
LOG.warn("Checking for domain '{0}'"
"failed!".format(domain_name))
LOG.warning("Checking for domain '{0}'"
"failed!".format(domain_name))
LOG.exception(ex)
return False

Expand Down Expand Up @@ -584,9 +584,9 @@ def get_service_limit(self, project_id):
return max_services

except ValueError as ex:
LOG.warn("Checking if non-default service"
"limit exists for"
"project_id: {0} failed!".format(project_id))
LOG.warning("Checking if non-default service"
"limit exists for"
"project_id: {0} failed!".format(project_id))
LOG.exception(ex)
return max_services

Expand Down

0 comments on commit 25a68c2

Please sign in to comment.