
Untitled
By: a guest on
Jun 4th, 2012 | syntax:
None | size: 1.09 KB | hits: 8 | expires: Never
=== modified file 'nova/virt/xenapi_conn.py'
--- nova/virt/xenapi_conn.py 2010-12-15 18:38:30 +0000
+++ nova/virt/xenapi_conn.py 2010-12-15 19:37:25 +0000
@@ -52,6 +52,7 @@
import xmlrpclib
from eventlet import event
+from eventlet import tpool
from nova import utils
from nova import flags
@@ -164,13 +165,13 @@
f = self._session.xenapi
for m in method.split('.'):
f = f.__getattr__(m)
- return f(*args)
+ return tpool.execute(f, *args)
def async_call_plugin(self, plugin, fn, args):
"""Call Async.host.call_plugin on a background thread."""
- return _unwrap_plugin_exceptions(
- self._session.xenapi.Async.host.call_plugin,
- self.get_xenapi_host(), plugin, fn, args)
+ return tpool.execute(_unwrap_plugin_exceptions,
+ self._session.xenapi.Async.host.call_plugin,
+ self.get_xenapi_host(), plugin, fn, args)
def wait_for_task(self, task):
"""Return a Deferred that will give the result of the given task.