summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2012-01-06 19:04:16 +0000
committerVishvananda Ishaya <vishvananda@gmail.com>2012-01-06 11:05:12 -0800
commitb27e14dc96014fb99427593b7f6c406ef29006e5 (patch)
tree861771e823277b55ef345908f51cf6fda3f86bca
parentde4fb9302aab979ac3dbb8b2e62c9f9255f8f16f (diff)
downloadnova-b27e14dc96014fb99427593b7f6c406ef29006e5.tar.gz
nova-b27e14dc96014fb99427593b7f6c406ef29006e5.tar.xz
nova-b27e14dc96014fb99427593b7f6c406ef29006e5.zip
Workaround bug 852095 without importing mox
* Fixes bug 912828 Change-Id: Iade4b0aca1d1f28ce46ed25d0b97c08d152554bd
-rw-r--r--nova/utils.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/nova/utils.py b/nova/utils.py
index c55bd6322..991e68b3b 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -41,7 +41,6 @@ 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
@@ -690,10 +689,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):
+ # FIXME(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
+ # we up the dependency to 0.5.4 (when it is released) we
+ # can remove this workaround.
+ if getattr(value, '__module__', None) == 'mox':
return 'mock'
if level > 3: