diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2010-08-25 16:22:49 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2010-08-25 16:22:49 -0700 |
| commit | af959df4076d41d950baa27905d15fbda017e0cb (patch) | |
| tree | 10fe2897471a00fb424c8e25fad3c86326b27019 /nova/utils.py | |
| parent | 70112ea9941b92aa98e32c0c37f0208877953557 (diff) | |
| parent | 686ad09fe4416bb578661a42f6f083528d4a7ca9 (diff) | |
merged trunk and fixed tests
Diffstat (limited to 'nova/utils.py')
| -rw-r--r-- | nova/utils.py | 8 |
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 |
