summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index efefc5fd1..3d2f901a8 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -41,6 +41,7 @@ from eventlet import event
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 '?'