summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorJustin Santa Barbara <justin@fathomdb.com>2011-03-24 01:56:06 -0700
committerJustin Santa Barbara <justin@fathomdb.com>2011-03-24 01:56:06 -0700
commit40a6ded37544dcfe44ba9d3ef247339122c93b43 (patch)
treec7d8ac401025037cbc841cbeab47d7b5800b9851 /nova/utils.py
parent3cde42aaac50e32f2c8fcd4493c40a2eaf1a0d4d (diff)
parent86b3cc94bc672fda7925a247c3b7c2f85be2c5b5 (diff)
downloadnova-40a6ded37544dcfe44ba9d3ef247339122c93b43.tar.gz
nova-40a6ded37544dcfe44ba9d3ef247339122c93b43.tar.xz
nova-40a6ded37544dcfe44ba9d3ef247339122c93b43.zip
Merged with conflict and resolved conflict (with my own patch, no less)
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 352c5d9f9..e4d8a70eb 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -335,6 +335,14 @@ def utcnow():
utcnow.override_time = None
+def is_older_than(before, seconds):
+ """Return True if before is older than 'seconds'"""
+ if utcnow() - before > datetime.timedelta(seconds=seconds):
+ return True
+ else:
+ return False
+
+
def utcnow_ts():
"""Timestamp version of our utcnow function."""
return time.mktime(utcnow().timetuple())