summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-01-10 05:12:48 -0400
committerSandy Walsh <sandy.walsh@rackspace.com>2011-01-10 05:12:48 -0400
commit72e9f0819837da68c52f5604e83385037fdcdfb2 (patch)
tree222700c3d443d4ec08a49dcb4f9e4312dd99558b /nova
parentf9d1a59fc10425b0a9b82edca857c771e6be9809 (diff)
Fixed xenapi_conn wait_for_task to properly terminate LoopingCall on exception
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/xenapi/stubs.py2
-rw-r--r--nova/virt/xenapi_conn.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py
index d7a9a5f3e..292bd9ba9 100644
--- a/nova/tests/xenapi/stubs.py
+++ b/nova/tests/xenapi/stubs.py
@@ -47,7 +47,7 @@ def stubout_instance_snapshot(stubs):
stubs.Set(xenapi_conn.XenAPISession, 'wait_for_task',
fake_wait_for_task)
- stubs.Set(xenapi_conn.XenAPISession, 'stop_loop', fake_loop)
+ stubs.Set(xenapi_conn.XenAPISession, '_stop_loop', fake_loop)
from nova.virt.xenapi.fake import create_vdi
name_label = "instance-%s" % instance_id
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index f4293ef3b..b8ab9245f 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -243,7 +243,8 @@ class XenAPISession(object):
self.loop.stop()
return rv
- def stop_loop(self):
+ def _stop_loop(self):
+ """Stop polling for task to finish."""
#NOTE(sandy-walsh) Had to break this call out to support unit tests.
if self.loop:
self.loop.stop()
@@ -284,7 +285,7 @@ class XenAPISession(object):
except self.XenAPI.Failure, exc:
LOG.warn(exc)
done.send_exception(*sys.exc_info())
- self.stop_loop()
+ self._stop_loop()
def _unwrap_plugin_exceptions(self, func, *args, **kwargs):
"""Parse exception details"""