diff options
author | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-24 01:56:06 -0700 |
---|---|---|
committer | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-24 01:56:06 -0700 |
commit | 40a6ded37544dcfe44ba9d3ef247339122c93b43 (patch) | |
tree | c7d8ac401025037cbc841cbeab47d7b5800b9851 /nova/utils.py | |
parent | 3cde42aaac50e32f2c8fcd4493c40a2eaf1a0d4d (diff) | |
parent | 86b3cc94bc672fda7925a247c3b7c2f85be2c5b5 (diff) | |
download | nova-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.py | 8 |
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()) |