From b27e14dc96014fb99427593b7f6c406ef29006e5 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 6 Jan 2012 19:04:16 +0000 Subject: Workaround bug 852095 without importing mox * Fixes bug 912828 Change-Id: Iade4b0aca1d1f28ce46ed25d0b97c08d152554bd --- nova/utils.py | 11 ++++++----- 1 file 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: -- cgit