Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 4th, 2012  |  syntax: None  |  size: 1.09 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. === modified file 'nova/virt/xenapi_conn.py'
  2. --- nova/virt/xenapi_conn.py    2010-12-15 18:38:30 +0000
  3. +++ nova/virt/xenapi_conn.py    2010-12-15 19:37:25 +0000
  4. @@ -52,6 +52,7 @@
  5.  import xmlrpclib
  6.  
  7.  from eventlet import event
  8. +from eventlet import tpool
  9.  
  10.  from nova import utils
  11.  from nova import flags
  12. @@ -164,13 +165,13 @@
  13.          f = self._session.xenapi
  14.          for m in method.split('.'):
  15.              f = f.__getattr__(m)
  16. -        return f(*args)
  17. +        return tpool.execute(f, *args)
  18.  
  19.      def async_call_plugin(self, plugin, fn, args):
  20.          """Call Async.host.call_plugin on a background thread."""
  21. -        return _unwrap_plugin_exceptions(
  22. -            self._session.xenapi.Async.host.call_plugin,
  23. -            self.get_xenapi_host(), plugin, fn, args)
  24. +        return tpool.execute(_unwrap_plugin_exceptions,
  25. +                             self._session.xenapi.Async.host.call_plugin,
  26. +                             self.get_xenapi_host(), plugin, fn, args)
  27.  
  28.      def wait_for_task(self, task):
  29.          """Return a Deferred that will give the result of the given task.