summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-08-25 16:22:49 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2010-08-25 16:22:49 -0700
commitaf959df4076d41d950baa27905d15fbda017e0cb (patch)
tree10fe2897471a00fb424c8e25fad3c86326b27019 /nova/utils.py
parent70112ea9941b92aa98e32c0c37f0208877953557 (diff)
parent686ad09fe4416bb578661a42f6f083528d4a7ca9 (diff)
merged trunk and fixed tests
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index dc3c626ec..ef8405fc0 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -29,6 +29,8 @@ import subprocess
import socket
import sys
+from twisted.internet.threads import deferToThread
+
from nova import exception
from nova import flags
@@ -148,3 +150,9 @@ def isotime(at=None):
def parse_isotime(timestr):
return datetime.datetime.strptime(timestr, TIME_FORMAT)
+
+
+def deferredToThread(f):
+ def g(*args, **kwargs):
+ return deferToThread(f, *args, **kwargs)
+ return g