Skip to content

Commit 993282d

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Replace pytz by built-in datetime module"
2 parents 96376a5 + 8b2dbb5 commit 993282d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/users.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import datetime
1616
import os
17-
import pytz
1817

1918
from oslo_log import log as oslo_logging
2019

@@ -70,11 +69,11 @@ def _get_expire_interval(self, data):
7069
if isinstance(expiredate, str):
7170
year, month, day = map(int, expiredate.split('-'))
7271
expiredate = datetime.datetime(year=year, month=month, day=day,
73-
tzinfo=pytz.utc)
72+
tzinfo=datetime.timezone.utc)
7473
# Py2.7 does not support timestamps, this is the
7574
# only way to compute the seconds passed since the unix epoch
7675
unix_time = datetime.datetime(year=1970, month=1, day=1,
77-
tzinfo=pytz.utc)
76+
tzinfo=datetime.timezone.utc)
7877
expire_interval = (expiredate - unix_time).total_seconds()
7978

8079
return expire_interval

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ oslo.log
77
Babel>=1.3
88
oauthlib
99
netifaces
10-
pytz
1110
PyYAML
1211
requests
1312
untangle==1.2.1

0 commit comments

Comments
 (0)