Replace pytz
pytz hasn't been listed in requirements but has been installed explicitly via dependency. Because its usage can be quite easily replaced by the built-in datetime module, remove it to reduce external dependencies. Change-Id: Idec1b5861ed0eaf1882c259a61a1ccbffbdb0bf6
This commit is contained in:
parent
c224256eb5
commit
e877f17cd3
@ -24,7 +24,6 @@ import msgpack
|
|||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import pytz
|
|
||||||
import txaio
|
import txaio
|
||||||
|
|
||||||
from zaqar.common import consts
|
from zaqar.common import consts
|
||||||
@ -154,7 +153,7 @@ class MessagingProtocol(websocket.WebSocketServerProtocol):
|
|||||||
self._auth_app = None
|
self._auth_app = None
|
||||||
expire = env['keystone.token_info']['token']['expires_at']
|
expire = env['keystone.token_info']['token']['expires_at']
|
||||||
expire_time = timeutils.parse_isotime(expire)
|
expire_time = timeutils.parse_isotime(expire)
|
||||||
now = datetime.datetime.now(tz=pytz.UTC)
|
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||||
delta = (expire_time - now).total_seconds()
|
delta = (expire_time - now).total_seconds()
|
||||||
if self._deauth_handle is not None:
|
if self._deauth_handle is not None:
|
||||||
self._deauth_handle.cancel()
|
self._deauth_handle.cancel()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user