Navigation Menu

Skip to content

Commit

Permalink
Merge "Add in missing log hints"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jun 9, 2016
2 parents 551018a + b54d3d1 commit e72e12b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions glance/api/middleware/context.py
Expand Up @@ -21,7 +21,7 @@
from glance.api import policy
from glance.common import wsgi
import glance.context
from glance.i18n import _
from glance.i18n import _, _LW


context_opts = [
Expand Down Expand Up @@ -52,7 +52,7 @@ def process_response(self, resp):
try:
request_id = resp.request.context.request_id
except AttributeError:
LOG.warn(_('Unable to retrieve request id from context'))
LOG.warn(_LW('Unable to retrieve request id from context'))
else:
# For python 3 compatibility need to use bytes type
prefix = b'req-' if isinstance(request_id, bytes) else 'req-'
Expand Down
10 changes: 5 additions & 5 deletions glance/async/flows/ovf_process.py
Expand Up @@ -243,11 +243,11 @@ def _load_interested_properties(self):
self.interested_properties = properties.get(
'cim_pasd', [])
if not self.interested_properties:
LOG.warn(_('OVF metadata of interest was not specified '
'in ovf-metadata.json config file. Please set '
'"cim_pasd" to a list of interested '
'CIM_ProcessorAllocationSettingData '
'properties.'))
LOG.warn(_LW('OVF metadata of interest was not specified '
'in ovf-metadata.json config file. Please '
'set "cim_pasd" to a list of interested '
'CIM_ProcessorAllocationSettingData '
'properties.'))
else:
LOG.warn(_('OVF properties config file "ovf-metadata.json" was '
'not found.'))
Expand Down
8 changes: 4 additions & 4 deletions glance/common/property_utils.py
Expand Up @@ -21,7 +21,7 @@

import glance.api.policy
from glance.common import exception
from glance.i18n import _, _LE
from glance.i18n import _, _LE, _LW

CONFIG = configparser.SafeConfigParser()
LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -125,9 +125,9 @@ def _load_rules(self):
else:
property_dict[operation] = []
LOG.warn(
_('Property protection on operation %(operation)s'
' for rule %(rule)s is not found. No role will be'
' allowed to perform this operation.') %
_LW('Property protection on operation %(operation)s'
' for rule %(rule)s is not found. No role will be'
' allowed to perform this operation.') %
{'operation': operation,
'rule': property_exp})

Expand Down
17 changes: 9 additions & 8 deletions glance/common/utils.py
Expand Up @@ -44,7 +44,7 @@
from webob import exc

from glance.common import exception
from glance.i18n import _, _LE
from glance.i18n import _, _LE, _LW

CONF = cfg.CONF

Expand Down Expand Up @@ -421,13 +421,14 @@ def validate_key_cert(key_file, cert_file):
data = encodeutils.to_utf8(data)
digest = CONF.digest_algorithm
if digest == 'sha1':
LOG.warn('The FIPS (FEDERAL INFORMATION PROCESSING STANDARDS)'
' state that the SHA-1 is not suitable for'
' general-purpose digital signature applications (as'
' specified in FIPS 186-3) that require 112 bits of'
' security. The default value is sha1 in Kilo for a'
' smooth upgrade process, and it will be updated'
' with sha256 in next release(L).')
LOG.warn(
_LW('The FIPS (FEDERAL INFORMATION PROCESSING STANDARDS)'
' state that the SHA-1 is not suitable for'
' general-purpose digital signature applications (as'
' specified in FIPS 186-3) that require 112 bits of'
' security. The default value is sha1 in Kilo for a'
' smooth upgrade process, and it will be updated'
' with sha256 in next release(L).'))
out = crypto.sign(key, data, digest)
crypto.verify(cert, out, data, digest)
except crypto.Error as ce:
Expand Down
6 changes: 3 additions & 3 deletions glance/glare/location.py
Expand Up @@ -22,7 +22,7 @@
from glance.common.glare import definitions
from glance.common import utils
from glance.glare.domain import proxy
from glance.i18n import _, _LE, _LW
from glance.i18n import _LE, _LW

CONF = cfg.CONF
LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -156,8 +156,8 @@ def data_stream(self):
context=self.context)
return data
except Exception as e:
LOG.warn(_('Get blob %(name)s data failed: '
'%(err)s.')
LOG.warn(_LW('Get blob %(name)s data failed: '
'%(err)s.')
% {'name': self.blob.item_key,
'err': encodeutils.exception_to_unicode(e)})
err = e
Expand Down
6 changes: 3 additions & 3 deletions glance/location.py
Expand Up @@ -27,7 +27,7 @@
from glance.common import signature_utils
from glance.common import utils
import glance.domain.proxy
from glance.i18n import _, _LE, _LI
from glance.i18n import _, _LE, _LI, _LW


CONF = cfg.CONF
Expand Down Expand Up @@ -462,8 +462,8 @@ def get_data(self, offset=0, chunk_size=None):

return data
except Exception as e:
LOG.warn(_('Get image %(id)s data failed: '
'%(err)s.')
LOG.warn(_LW('Get image %(id)s data failed: '
'%(err)s.')
% {'id': self.image.image_id,
'err': encodeutils.exception_to_unicode(e)})
err = e
Expand Down

0 comments on commit e72e12b

Please sign in to comment.