diff --git a/nova/utils.py b/nova/utils.py index efefc5fd16d..3d2f901a809 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -41,6 +41,7 @@ from eventlet import greenthread from eventlet import semaphore from eventlet.green import subprocess +import mox import netaddr from nova import exception @@ -689,6 +690,12 @@ def to_primitive(value, convert_instances=False, level=0): if test(value): return unicode(value) + # NOTE(vish): Workaround for LP bug 852095. Without this workaround, + # tests that raise an exception in a mocked method that + # has a @wrap_exception with a notifier will fail. + if isinstance(value, mox.MockAnything): + return 'mock' + if level > 3: return '?'