diff options
| author | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-08-25 10:38:25 -0400 |
|---|---|---|
| committer | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-08-25 10:38:25 -0400 |
| commit | 428b3256ad7e47e9f389ac8ce0ff70cc3d720e9e (patch) | |
| tree | de20500a4346af56a96b94348bdf4f7d3834ec65 /nova/utils.py | |
| parent | 96ae5e2776218adfee2cb22a4c0d7358a498a451 (diff) | |
| parent | e185a95ae6396e86e92b4a5e7ec92b5b422847d5 (diff) | |
Merge from trunk
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 |
