From 2f4d33caabdc76962e21b5fe46cb5d45733d56ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Tue, 2 Jun 2020 20:07:49 +0200 Subject: [PATCH] Stop to use the __future__ module. The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: I8bad429563b89ad459d1b1910083484f2ccf9fff --- cinder/cmd/manage.py | 2 -- cinder/image/glance.py | 3 --- cinder/tests/fixtures.py | 2 -- cinder/volume/drivers/dell_emc/unity/utils.py | 2 -- cinder/volume/drivers/storpool.py | 2 -- 5 files changed, 11 deletions(-) diff --git a/cinder/cmd/manage.py b/cinder/cmd/manage.py index e5e92cdcac8..45fc102f4b8 100644 --- a/cinder/cmd/manage.py +++ b/cinder/cmd/manage.py @@ -50,8 +50,6 @@ """CLI interface for cinder management.""" -from __future__ import print_function - try: import collections.abc as collections except ImportError: diff --git a/cinder/image/glance.py b/cinder/image/glance.py index 37133b51f5a..f2a6648d9af 100644 --- a/cinder/image/glance.py +++ b/cinder/image/glance.py @@ -16,9 +16,6 @@ """Implementation of an image service that uses Glance as the backend""" - -from __future__ import absolute_import - import copy import itertools import random diff --git a/cinder/tests/fixtures.py b/cinder/tests/fixtures.py index 79e0b73b4cd..67754c689cd 100644 --- a/cinder/tests/fixtures.py +++ b/cinder/tests/fixtures.py @@ -15,8 +15,6 @@ # under the License. """Fixtures for Cinder tests.""" -# NOTE(mriedem): This is needed for importing from fixtures. -from __future__ import absolute_import import logging as std_logging import os diff --git a/cinder/volume/drivers/dell_emc/unity/utils.py b/cinder/volume/drivers/dell_emc/unity/utils.py index d924f6ed1fa..253838086ac 100644 --- a/cinder/volume/drivers/dell_emc/unity/utils.py +++ b/cinder/volume/drivers/dell_emc/unity/utils.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import division - import contextlib from distutils import version import functools diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py index b3e1a786859..2a379be4b49 100644 --- a/cinder/volume/drivers/storpool.py +++ b/cinder/volume/drivers/storpool.py @@ -15,8 +15,6 @@ """StorPool block device driver""" -from __future__ import absolute_import - import platform from oslo_config import cfg