Add i18n translation to guestagent 1/5

This is 1 of 5 commits to add translation to the guestagent
directory.

Custom hacking rules will be added later to enforce the style.

Change-Id: I2b0313021fd9599bdaeb375358e8cf834581d493
This commit is contained in:
Trevor McCasland 2016-12-05 08:58:07 -06:00 committed by amrith
parent 4f9c538f68
commit 7e2d305130
2 changed files with 5 additions and 3 deletions

View File

@ -54,8 +54,10 @@ class BackupAgent(object):
try:
runner = get_restore_strategy(backup_type, RESTORE_NAMESPACE)
except ImportError:
raise UnknownBackupType("Unknown Backup type: %s in namespace %s"
% (backup_type, RESTORE_NAMESPACE))
raise UnknownBackupType(_("Unknown Backup type: %(type)s in "
"namespace %(ns)s")
% {"type": backup_type,
"ns": RESTORE_NAMESPACE})
return runner
def stream_backup_to_storage(self, context, backup_info, runner, storage,

View File

@ -77,7 +77,7 @@ def get_filesystem_volume_stats(fs_path):
stats = os.statvfs(fs_path)
except OSError:
LOG.exception(_("Error getting volume stats."))
raise RuntimeError("Filesystem not found (%s)" % fs_path)
raise RuntimeError(_("Filesystem not found (%s)") % fs_path)
total = stats.f_blocks * stats.f_bsize
free = stats.f_bfree * stats.f_bsize