diff options
author | Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com> | 2014-02-13 10:38:41 +0100 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-04-09 12:53:16 +0000 |
commit | 3d35f04d8dd2a3620f9b935f17b71e2e8de05964 (patch) | |
tree | bdad8d8c746758068a439cc550f9693f121b631d /nova | |
parent | 9f7ea62d06ecd5dedb6e8304df4900634b4d222a (diff) | |
download | nova-3d35f04d8dd2a3620f9b935f17b71e2e8de05964.tar.gz |
compute: using format_message() to convert exception to string
We probably need to use format_message when converting a
NovaException to a string.
As well we can remove the cast to unicode of the parameter msg
from the local method notify since this method will only get
message in a string format.
Change-Id: I6fddfb9e124b4096f0ebc3da81c3044b1b24cedf
Diffstat (limited to 'nova')
-rw-r--r-- | nova/compute/manager.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 384e968a8a..3cd4fc9d33 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1182,7 +1182,7 @@ class ComputeManager(manager.Manager): """Send a create.{start,error,end} notification.""" type_ = "create.%(status)s" % dict(status=status) info = extra_usage_info.copy() - info['message'] = unicode(msg) + info['message'] = msg self._notify_about_instance_usage(context, instance, type_, extra_usage_info=info, fault=fault, **kwargs) @@ -1211,7 +1211,7 @@ class ComputeManager(manager.Manager): except exception.BuildAbortException as e: # Instance build aborted due to a non-failure LOG.info(e) - notify("end", msg=unicode(e)) # notify that build is done + notify("end", msg=e.format_message()) # notify that build is done except Exception as e: # Instance build encountered a non-recoverable error: |