diff options
| author | Cory Wright <cory.wright@rackspace.com> | 2010-12-22 11:28:25 -0500 |
|---|---|---|
| committer | Cory Wright <cory.wright@rackspace.com> | 2010-12-22 11:28:25 -0500 |
| commit | ba7afd00a4ea826fc12113d98de391aace1fd2d2 (patch) | |
| tree | df35d22040e8bcd0cd79d2b841efd1386b67554d /nova/utils.py | |
| parent | 4ef1a234aaee98e55a5d8e3d8fac1f8f282c803d (diff) | |
| parent | d9b37f9a3b6cc7dbf6026ceb94b9e4c585e59e01 (diff) | |
| download | nova-ba7afd00a4ea826fc12113d98de391aace1fd2d2.tar.gz nova-ba7afd00a4ea826fc12113d98de391aace1fd2d2.tar.xz nova-ba7afd00a4ea826fc12113d98de391aace1fd2d2.zip | |
merging trunk
Diffstat (limited to 'nova/utils.py')
| -rw-r--r-- | nova/utils.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/nova/utils.py b/nova/utils.py index ea1f04ca7..16b509b48 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -50,7 +50,7 @@ def import_class(import_str): __import__(mod_str) return getattr(sys.modules[mod_str], class_str) except (ImportError, ValueError, AttributeError): - raise exception.NotFound('Class %s cannot be found' % class_str) + raise exception.NotFound(_('Class %s cannot be found') % class_str) def import_object(import_str): @@ -64,7 +64,7 @@ def import_object(import_str): def fetchfile(url, target): - logging.debug("Fetching %s" % url) + logging.debug(_("Fetching %s") % url) # c = pycurl.Curl() # fp = open(target, "wb") # c.setopt(c.URL, url) @@ -76,7 +76,7 @@ def fetchfile(url, target): def execute(cmd, process_input=None, addl_env=None, check_exit_code=True): - logging.debug("Running cmd (subprocess): %s", cmd) + logging.debug(_("Running cmd (subprocess): %s"), cmd) env = os.environ.copy() if addl_env: env.update(addl_env) @@ -89,7 +89,7 @@ def execute(cmd, process_input=None, addl_env=None, check_exit_code=True): result = obj.communicate() obj.stdin.close() if obj.returncode: - logging.debug("Result was %s" % (obj.returncode)) + logging.debug(_("Result was %s") % (obj.returncode)) if check_exit_code and obj.returncode != 0: (stdout, stderr) = result raise ProcessExecutionError(exit_code=obj.returncode, @@ -127,7 +127,7 @@ def debug(arg): def runthis(prompt, cmd, check_exit_code=True): - logging.debug("Running %s" % (cmd)) + logging.debug(_("Running %s") % (cmd)) rv, err = execute(cmd, check_exit_code=check_exit_code) @@ -160,7 +160,7 @@ def get_my_ip(): csock.close() return addr except socket.gaierror as ex: - logging.warn("Couldn't get IP, using 127.0.0.1 %s", ex) + logging.warn(_("Couldn't get IP, using 127.0.0.1 %s"), ex) return "127.0.0.1" @@ -204,7 +204,7 @@ class LazyPluggable(object): if not self.__backend: backend_name = self.__pivot.value if backend_name not in self.__backends: - raise exception.Error('Invalid backend: %s' % backend_name) + raise exception.Error(_('Invalid backend: %s') % backend_name) backend = self.__backends[backend_name] if type(backend) == type(tuple()): |
