diff options
author | Ed Leafe <ed@leafe.com> | 2011-01-25 11:53:48 +0000 |
---|---|---|
committer | Tarmac <> | 2011-01-25 11:53:48 +0000 |
commit | bca5b5650921307ec97602607817de6109fb819d (patch) | |
tree | 39505955f7f15dcc7a764a34a9fa920c01112cab /nova/exception.py | |
parent | 671557507ae65ff5521e32f0d6cf2342e3a5af55 (diff) | |
parent | 6de7cb36e9d848f87bde6caa45eeaeb4bf76296a (diff) | |
download | nova-bca5b5650921307ec97602607817de6109fb819d.tar.gz nova-bca5b5650921307ec97602607817de6109fb819d.tar.xz nova-bca5b5650921307ec97602607817de6109fb819d.zip |
Localized strings that employ formatting should not use positional arguments, as they prevent the translator from re-ordering the translated text; instead, they should use mappings (i.e., dicts). This change replaces all localized formatted strings that use more than one formatting placeholder with a mapping version.
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/exception.py b/nova/exception.py index ecd814e5d..2320e2214 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -33,8 +33,9 @@ class ProcessExecutionError(IOError): description = _("Unexpected error while running command.") if exit_code is None: exit_code = '-' - message = _("%s\nCommand: %s\nExit code: %s\nStdout: %r\nStderr: %r")\ - % (description, cmd, exit_code, stdout, stderr) + message = _("%(description)s\nCommand: %(cmd)s\n" + "Exit code: %(exit_code)s\nStdout: %(stdout)r\n" + "Stderr: %(stderr)r") % locals() IOError.__init__(self, message) |