diff --git a/cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/users.py b/cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/users.py index b09aaa74..c7bc240e 100644 --- a/cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/users.py +++ b/cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/users.py @@ -14,7 +14,6 @@ import datetime import os -import pytz from oslo_log import log as oslo_logging @@ -70,11 +69,11 @@ class UsersPlugin(base.BaseCloudConfigPlugin): 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 diff --git a/requirements.txt b/requirements.txt index a0ef6b40..79adbc62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,6 @@ oslo.log Babel>=1.3 oauthlib netifaces -pytz PyYAML requests untangle==1.2.1