Skip to content

Commit

Permalink
Merge "Replace pytz by built-in datetime module"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Jun 11, 2024
2 parents 96376a5 + 8b2dbb5 commit 993282d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import datetime
import os
import pytz

from oslo_log import log as oslo_logging

Expand Down Expand Up @@ -70,11 +69,11 @@ def _get_expire_interval(self, data):
if isinstance(expiredate, str):
year, month, day = map(int, expiredate.split('-'))
expiredate = datetime.datetime(year=year, month=month, day=day,
tzinfo=pytz.utc)
tzinfo=datetime.timezone.utc)
# Py2.7 does not support timestamps, this is the
# only way to compute the seconds passed since the unix epoch
unix_time = datetime.datetime(year=1970, month=1, day=1,
tzinfo=pytz.utc)
tzinfo=datetime.timezone.utc)
expire_interval = (expiredate - unix_time).total_seconds()

return expire_interval
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ oslo.log
Babel>=1.3
oauthlib
netifaces
pytz
PyYAML
requests
untangle==1.2.1
Expand Down

0 comments on commit 993282d

Please sign in to comment.