Limit monotonic to py2
A recent requirements change [1] restricted monotonic to <py3.3, meaning that any subsequent change triggering the requirements-check job will fail until that's synced. Do that. In order to make this sane, we need to be sure we're only using monotonic if it's available. In oslo_service.__init__.py, we're using the actual library if eventlet is. In periodic_task.py we're using the actual library if the monotonic() method isn't available in the time module. [1] Ib8c1bf08f5fa7463911602b0df19315907c81e04 Change-Id: I3b24a089b780aac2746f48f7d5b538546ccce982
This commit is contained in:
parent
3e08f3375e
commit
643578c899
|
@ -13,7 +13,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import eventlet.patcher
|
import eventlet.patcher
|
||||||
import monotonic
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
time = eventlet.patcher.original('time')
|
time = eventlet.patcher.original('time')
|
||||||
|
@ -27,6 +26,7 @@ if hasattr(time, 'monotonic'):
|
||||||
# Use builtin monotonic clock, Python 3.3+
|
# Use builtin monotonic clock, Python 3.3+
|
||||||
_monotonic = time.monotonic
|
_monotonic = time.monotonic
|
||||||
else:
|
else:
|
||||||
|
import monotonic
|
||||||
_monotonic = monotonic.monotonic
|
_monotonic = monotonic.monotonic
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,11 @@ import logging
|
||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from monotonic import monotonic as now # noqa
|
if hasattr(time, 'monotonic'):
|
||||||
|
now = time.monotonic
|
||||||
|
else:
|
||||||
|
from monotonic import monotonic as now # noqa
|
||||||
|
|
||||||
from oslo_utils import reflection
|
from oslo_utils import reflection
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
WebOb>=1.7.1 # MIT
|
WebOb>=1.7.1 # MIT
|
||||||
eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT
|
eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT
|
||||||
greenlet>=0.4.10 # MIT
|
greenlet>=0.4.10 # MIT
|
||||||
monotonic>=0.6 # Apache-2.0
|
monotonic>=0.6;python_version<'3.3' # Apache-2.0
|
||||||
oslo.utils>=3.33.0 # Apache-2.0
|
oslo.utils>=3.33.0 # Apache-2.0
|
||||||
oslo.concurrency>=3.25.0 # Apache-2.0
|
oslo.concurrency>=3.25.0 # Apache-2.0
|
||||||
oslo.config>=5.1.0 # Apache-2.0
|
oslo.config>=5.1.0 # Apache-2.0
|
||||||
|
|
Loading…
Reference in New Issue