Implementing the use of _L’x’/i18n markers

Placing the _Lx markers back into the code.  No other cleaner solution has
has been implemented. Patches will be submitted in a series of sub
directories and in a fashion that is manageable.

Partial-Bug: #1384312

Change-Id: I62c708036a9cd5da431b7a95e9cd41167fb5273b
This commit is contained in:
Mike Mason
2014-10-23 13:16:42 +00:00
parent 9a13288cd2
commit 7e7ea5a609
11 changed files with 137 additions and 130 deletions

View File

@@ -43,13 +43,12 @@ from swiftclient import client as swift
from cinder.backup.driver import BackupDriver
from cinder import exception
from cinder.i18n import _
from cinder.i18n import _, _LE, _LI, _LW
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import timeutils
from cinder.openstack.common import units
LOG = logging.getLogger(__name__)
swiftbackup_service_opts = [
@@ -157,8 +156,8 @@ class SwiftBackupDriver(BackupDriver):
CONF.backup_swift_auth))
if CONF.backup_swift_auth == 'single_user':
if CONF.backup_swift_user is None:
LOG.error(_("single_user auth mode enabled, "
"but %(param)s not set")
LOG.error(_LE("single_user auth mode enabled, "
"but %(param)s not set")
% {'param': 'backup_swift_user'})
raise exception.ParameterNotFound(param='backup_swift_user')
self.conn = swift.Connection(
@@ -392,7 +391,7 @@ class SwiftBackupDriver(BackupDriver):
except Exception as err:
with excutils.save_and_reraise_exception():
LOG.exception(
_("Backup volume metadata to swift failed: %s") %
_LE("Backup volume metadata to swift failed: %s") %
six.text_type(err))
self.delete(backup)
@@ -448,8 +447,9 @@ class SwiftBackupDriver(BackupDriver):
try:
fileno = volume_file.fileno()
except IOError:
LOG.info("volume_file does not support fileno() so skipping "
"fsync()")
LOG.info(_LI("volume_file does not support "
"fileno() so skipping"
"fsync()"))
else:
os.fsync(fileno)
@@ -514,8 +514,8 @@ class SwiftBackupDriver(BackupDriver):
try:
swift_object_names = self._generate_object_names(backup)
except Exception:
LOG.warn(_('swift error while listing objects, continuing'
' with delete'))
LOG.warn(_LW('swift error while listing objects, continuing'
' with delete'))
for swift_object_name in swift_object_names:
try:
@@ -523,8 +523,9 @@ class SwiftBackupDriver(BackupDriver):
except socket.error as err:
raise exception.SwiftConnectionFailed(reason=err)
except Exception:
LOG.warn(_('swift error while deleting object %s, '
'continuing with delete') % swift_object_name)
LOG.warn(_LW('swift error while deleting object %s, '
'continuing with delete')
% swift_object_name)
else:
LOG.debug('deleted swift object: %(swift_object_name)s'
' in container: %(container)s' %