Navigation Menu

Skip to content

Commit

Permalink
Adds workaround check for mox in to_primitive
Browse files Browse the repository at this point in the history
 * Works around bug 852095
 * Can be removed if a consistent mox 5.4 is released

Change-Id: I3e57b60886a94c5e7a337b73716759c9a6838e04
  • Loading branch information
vishvananda committed Jan 6, 2012
1 parent dcf5fe4 commit 613d1db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nova/utils.py
Expand Up @@ -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
Expand Down Expand Up @@ -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 '?'

Expand Down

0 comments on commit 613d1db

Please sign in to comment.