summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGinnis <sean.mcginnis@gmail.com>2020-05-04 17:30:01 -0500
committerSean McGinnis <sean.mcginnis@gmail.com>2020-05-04 17:30:01 -0500
commitf511ca0b92c784bf120980568f43f60aa1ad9925 (patch)
treecc2706062597771ed179be04097362e50f346484
parenta91e6b9e673270cc977f12c7c27dca023bb13ef8 (diff)
downloadoslo-utils-f511ca0b92c784bf120980568f43f60aa1ad9925.tar.gz
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 <sean.mcginnis@gmail.com>
-rw-r--r--oslo_utils/timeutils.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/oslo_utils/timeutils.py b/oslo_utils/timeutils.py
index 1e730a1..5512918 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()",