summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-03-23 14:41:35 -0500
committerJosh Kearney <josh@jk0.org>2011-03-23 14:41:35 -0500
commitabb764f51385a0b811b23379d78f7db027d4cca5 (patch)
tree30122144b3c26f545da66129d81b37bd7a9a2084 /nova/utils.py
parente40d692c55a02fa686e83bd87eca29a3cfa3d15e (diff)
downloadnova-abb764f51385a0b811b23379d78f7db027d4cca5.tar.gz
nova-abb764f51385a0b811b23379d78f7db027d4cca5.tar.xz
nova-abb764f51385a0b811b23379d78f7db027d4cca5.zip
Automatically unrescue instances after a given timeout
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 499af2039..38cdb8021 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -334,6 +334,13 @@ def utcnow():
utcnow.override_time = None
+def is_then_greater(then, seconds):
+ if utcnow() - then > datetime.timedelta(seconds=seconds):
+ return True
+ else:
+ return False
+
+
def utcnow_ts():
"""Timestamp version of our utcnow function."""
return time.mktime(utcnow().timetuple())