]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Provide i18n to those messages without _()
authordaisy-ycguo <daisy.ycguo@gmail.com>
Wed, 21 Nov 2012 16:16:04 +0000 (00:16 +0800)
committerdaisy-ycguo <daisy.ycguo@gmail.com>
Tue, 27 Nov 2012 08:07:12 +0000 (16:07 +0800)
bug 1081498

There are a few log messages without _(), but a lot messages with _().
Wrap these log messages with _() in order to make the code consistent.

Change-Id: Ie8961453569e9a75bd0fd0733344db8059d05222

cinder/db/sqlalchemy/migrate_repo/versions/001_cinder_init.py
cinder/db/sqlalchemy/migrate_repo/versions/003_glance_metadata.py
cinder/db/sqlalchemy/session.py
cinder/volume/drivers/nfs.py

index 6ca30faa9e89758141ea47871e569e5cb56a4e88..e46faf4b1338d0d4ada5c333e76473c021d01fe2 100644 (file)
@@ -240,7 +240,7 @@ def upgrade(migrate_engine):
             table.create()
         except Exception:
             LOG.info(repr(table))
-            LOG.exception('Exception while creating table.')
+            LOG.exception(_('Exception while creating table.'))
             raise
 
     if migrate_engine.name == "mysql":
@@ -269,4 +269,4 @@ def upgrade(migrate_engine):
 
 
 def downgrade(migrate_engine):
-    LOG.exception('Downgrade from initial Cinder install is unsupported.')
+    LOG.exception(_('Downgrade from initial Cinder install is unsupported.'))
index ff990a9e548f8f4d58c8a2291d915a512442172f..6fdf0750c9988516b64e220b725ff5ae503c53ab 100644 (file)
@@ -55,8 +55,8 @@ def upgrade(migrate_engine):
     try:
         volume_glance_metadata.create()
     except Exception:
-        LOG.exception("Exception while creating table "
-                      "'volume_glance_metedata'")
+        LOG.exception(_("Exception while creating table "
+                        "'volume_glance_metedata'"))
         meta.drop_all(tables=[volume_glance_metadata])
         raise
 
index 26b02299d36f72f50fb7f12c71e985e80b63851e..e1b06fb3a3aa0561177f9449e982d40c7b78a713 100644 (file)
@@ -68,7 +68,7 @@ def ping_listener(dbapi_conn, connection_rec, connection_proxy):
         dbapi_conn.cursor().execute('select 1')
     except dbapi_conn.OperationalError, ex:
         if ex.args[0] in (2006, 2013, 2014, 2045, 2055):
-            LOG.warn('Got mysql server has gone away: %s', ex)
+            LOG.warn(_('Got mysql server has gone away: %s'), ex)
             raise DisconnectionError("Database server went away")
         else:
             raise
index 8b2fc3be12796f06a205a61ea087044ab47c9c4f..1cce2f3f8f62675c5823a3ee6712083544d5a858 100644 (file)
@@ -191,7 +191,7 @@ class NfsDriver(driver.VolumeDriver):
                 self._ensure_share_mounted(share)
                 self._mounted_shares.append(share)
             except Exception, exc:
-                LOG.warning('Exception during mounting %s' % (exc,))
+                LOG.warning(_('Exception during mounting %s') % (exc,))
 
         LOG.debug('Available shares %s' % str(self._mounted_shares))