From f511ca0b92c784bf120980568f43f60aa1ad9925 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Mon, 4 May 2020 17:30:01 -0500 Subject: [PATCH] Remove monotonic usage The monotonic package was needed for monotonic time operations when running under Python runtimes older than 3.3. Since we now only support versions higher than this, this third party package requirement can now be removed. Change-Id: I7aa3b46a51e416f1c949538301be2365c39047ed Signed-off-by: Sean McGinnis --- oslo_utils/timeutils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/oslo_utils/timeutils.py b/oslo_utils/timeutils.py index 1e730a18..55129184 100644 --- a/oslo_utils/timeutils.py +++ b/oslo_utils/timeutils.py @@ -29,11 +29,6 @@ import six from oslo_utils import reflection -if hasattr(time, 'monotonic'): - now = time.monotonic -else: - from monotonic import monotonic as now # noqa - # ISO 8601 extended time format with microseconds _ISO8601_TIME_FORMAT_SUBSECOND = '%Y-%m-%dT%H:%M:%S.%f' _ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S' @@ -41,6 +36,8 @@ PERFECT_TIME_FORMAT = _ISO8601_TIME_FORMAT_SUBSECOND _MAX_DATETIME_SEC = 59 +now = time.monotonic + @removals.remove( message="use datetime.datetime.isoformat()",