Merge "Add log translation hints."
This commit is contained in:
commit
209c0a29ec
|
@ -27,6 +27,9 @@ from oslo.config import cfg
|
|||
|
||||
from nova import exception
|
||||
from nova.openstack.common.gettextutils import _
|
||||
from nova.openstack.common.gettextutils import _LE
|
||||
from nova.openstack.common.gettextutils import _LI
|
||||
from nova.openstack.common.gettextutils import _LW
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import processutils
|
||||
from nova.openstack.common import units
|
||||
|
@ -68,13 +71,13 @@ def get_fc_hbas():
|
|||
# and systool is not installed
|
||||
# 96 = nova.cmd.rootwrap.RC_NOEXECFOUND:
|
||||
if exc.exit_code == 96:
|
||||
LOG.warn(_("systool is not installed"))
|
||||
LOG.warn(_LW("systool is not installed"))
|
||||
return []
|
||||
except OSError as exc:
|
||||
# This handles the case where rootwrap is NOT used
|
||||
# and systool is not installed
|
||||
if exc.errno == errno.ENOENT:
|
||||
LOG.warn(_("systool is not installed"))
|
||||
LOG.warn(_LW("systool is not installed"))
|
||||
return []
|
||||
|
||||
if out is None:
|
||||
|
@ -233,7 +236,7 @@ def create_lvm_image(vg, lv, size, sparse=False):
|
|||
preallocated_space = 64 * units.Mi
|
||||
check_size(vg, lv, preallocated_space)
|
||||
if free_space < size:
|
||||
LOG.warning(_('Volume group %(vg)s will not be able'
|
||||
LOG.warn(_LW('Volume group %(vg)s will not be able'
|
||||
' to hold sparse volume %(lv)s.'
|
||||
' Virtual volume size is %(size)db,'
|
||||
' but free space on volume group is'
|
||||
|
@ -287,7 +290,7 @@ def remove_rbd_volumes(pool, *names):
|
|||
try:
|
||||
_run_rbd(*rbd_remove, attempts=3, run_as_root=True)
|
||||
except processutils.ProcessExecutionError:
|
||||
LOG.warn(_("rbd remove %(name)s in pool %(pool)s failed"),
|
||||
LOG.warn(_LW("rbd remove %(name)s in pool %(pool)s failed"),
|
||||
{'name': name, 'pool': pool})
|
||||
|
||||
|
||||
|
@ -391,7 +394,7 @@ def clear_logical_volume(path):
|
|||
volume_clear = CONF.libvirt.volume_clear
|
||||
|
||||
if volume_clear not in ('none', 'shred', 'zero'):
|
||||
LOG.error(_("ignoring unrecognized volume_clear='%s' value"),
|
||||
LOG.error(_LE("ignoring unrecognized volume_clear='%s' value"),
|
||||
volume_clear)
|
||||
volume_clear = 'zero'
|
||||
|
||||
|
@ -715,5 +718,5 @@ def is_mounted(mount_path, source=None):
|
|||
except OSError as exc:
|
||||
#info since it's not required to have this tool.
|
||||
if exc.errno == errno.ENOENT:
|
||||
LOG.info(_("findmnt tool is not installed"))
|
||||
LOG.info(_LI("findmnt tool is not installed"))
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue