From c6e05535886786fcb4938f90939da16f1514c490 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 27 Jan 2024 19:39:19 +0900 Subject: [PATCH] Remove dependency on pytz pytz will be removed from RHEL/CentOS 10 because of the built-in zoneinfo[1]. Because the current usage of pytz can be very easily replaced, this removes the dependency on pytz. [1] https://issues.redhat.com/browse/RHEL-219 Change-Id: Ia72c528eadeccf6075894ff58477fecade65ad71 --- ironic/common/utils.py | 3 +-- requirements.txt | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ironic/common/utils.py b/ironic/common/utils.py index efd3049a95..3699fe8a25 100644 --- a/ironic/common/utils.py +++ b/ironic/common/utils.py @@ -40,7 +40,6 @@ from oslo_utils import netutils from oslo_utils import strutils from oslo_utils import timeutils import psutil -import pytz from ironic.common import exception from ironic.common.i18n import _ @@ -453,7 +452,7 @@ def unix_file_modification_datetime(file_name): # normalize time to be UTC without timezone datetime.datetime.fromtimestamp( # fromtimestamp will return local time by default, make it UTC - os.path.getmtime(file_name), tz=pytz.utc + os.path.getmtime(file_name), tz=datetime.timezone.utc ) ) diff --git a/requirements.txt b/requirements.txt index cc17303f90..e4ea983de7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,6 @@ python-cinderclient!=4.0.0,>=3.3.0 # Apache-2.0 python-glanceclient>=2.8.0 # Apache-2.0 keystoneauth1>=4.2.0 # Apache-2.0 ironic-lib>=5.5.0 # Apache-2.0 -pytz>=2013.6 # MIT stevedore>=1.29.0 # Apache-2.0 oslo.concurrency>=4.2.0 # Apache-2.0 oslo.config>=6.8.0 # Apache-2.0