From 421b562a850086affe92e53712236fde2c0466ae Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 3 Jun 2015 15:38:15 +0200 Subject: [PATCH] Replace parse_strtime with parse_isotime in older/newer There's no reason to limit parsing to strtime format as isotime format is better and than parsing isotime also parses strtime formatted strings. Change-Id: I94dc4e9fa08b10139e3ef27fa94e33e0aa124110 --- oslo_utils/timeutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oslo_utils/timeutils.py b/oslo_utils/timeutils.py index 7a01e8f2..2b9e996d 100644 --- a/oslo_utils/timeutils.py +++ b/oslo_utils/timeutils.py @@ -119,7 +119,7 @@ def normalize_time(timestamp): def is_older_than(before, seconds): """Return True if before is older than seconds.""" if isinstance(before, six.string_types): - before = parse_strtime(before).replace(tzinfo=None) + before = parse_isotime(before).replace(tzinfo=None) else: before = before.replace(tzinfo=None) @@ -129,7 +129,7 @@ def is_older_than(before, seconds): def is_newer_than(after, seconds): """Return True if after is newer than seconds.""" if isinstance(after, six.string_types): - after = parse_strtime(after).replace(tzinfo=None) + after = parse_isotime(after).replace(tzinfo=None) else: after = after.replace(tzinfo=None)