From 524d1f1c7dee581b7a17b3dfc2041871604a1eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Tue, 2 Jun 2020 20:23:59 +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: Iaf6e2c9b16d053a8c279a48a25979c941b1c00da --- molteniron/molteniron | 2 -- molteniron/molteniron.py | 2 -- molteniron/moltenirond-helper | 2 -- molteniron/moltenirond.py | 2 -- molteniron/tests/testAddBMNode.py | 2 -- molteniron/tests/testAllocateBM.py | 2 -- molteniron/tests/testCull.py | 2 -- molteniron/tests/testDeallocateBM.py | 2 -- molteniron/tests/testDeallocateOwner.py | 2 -- molteniron/tests/testDoClean.py | 2 -- molteniron/tests/testGetField.py | 2 -- molteniron/tests/testGetIps.py | 2 -- molteniron/tests/testRemoveBMNode.py | 2 -- utils/createDB.py | 2 -- utils/test_hook_mi_ipmiblob.py | 2 -- 15 files changed, 30 deletions(-) diff --git a/molteniron/molteniron b/molteniron/molteniron index 302629c..98471ca 100755 --- a/molteniron/molteniron +++ b/molteniron/molteniron @@ -23,8 +23,6 @@ a MoltenIron server. # pylint: disable-msg=C0103 # pylint: disable=redefined-outer-name -from __future__ import print_function - import argparse import json from molteniron import molteniron diff --git a/molteniron/molteniron.py b/molteniron/molteniron.py index 31394f7..a2e3b6d 100644 --- a/molteniron/molteniron.py +++ b/molteniron/molteniron.py @@ -22,8 +22,6 @@ This is the MoltenIron client class that speaks to a MoltenIron server. # pylint: disable-msg=C0103 # pylint: disable=redefined-outer-name -from __future__ import print_function - import argparse import json import sys diff --git a/molteniron/moltenirond-helper b/molteniron/moltenirond-helper index 2095a45..efab8c6 100755 --- a/molteniron/moltenirond-helper +++ b/molteniron/moltenirond-helper @@ -22,8 +22,6 @@ This is a helper program for the MoltenIron server. # pylint: disable-msg=C0103 # pylint: disable=redefined-outer-name -from __future__ import print_function - import argparse from daemonize import Daemonize from molteniron import moltenirond diff --git a/molteniron/moltenirond.py b/molteniron/moltenirond.py index 1180898..101e245 100755 --- a/molteniron/moltenirond.py +++ b/molteniron/moltenirond.py @@ -27,8 +27,6 @@ This is the MoltenIron server. # pylint: disable-msg=C0103 # pylint: disable=redefined-outer-name -from __future__ import print_function - import argparse import calendar from datetime import datetime diff --git a/molteniron/tests/testAddBMNode.py b/molteniron/tests/testAddBMNode.py index 1fca2f6..360c620 100755 --- a/molteniron/tests/testAddBMNode.py +++ b/molteniron/tests/testAddBMNode.py @@ -21,8 +21,6 @@ Tests the addBMNode MoltenIron command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse from molteniron import moltenirond import os diff --git a/molteniron/tests/testAllocateBM.py b/molteniron/tests/testAllocateBM.py index 862c1b2..19bfb93 100755 --- a/molteniron/tests/testAllocateBM.py +++ b/molteniron/tests/testAllocateBM.py @@ -21,8 +21,6 @@ Tests the MoltenIron allocateBM command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse import json from molteniron import moltenirond diff --git a/molteniron/tests/testCull.py b/molteniron/tests/testCull.py index 0226539..26f9d1f 100755 --- a/molteniron/tests/testCull.py +++ b/molteniron/tests/testCull.py @@ -21,8 +21,6 @@ Tests the MoltenIron cull command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse import json from molteniron import moltenirond diff --git a/molteniron/tests/testDeallocateBM.py b/molteniron/tests/testDeallocateBM.py index d523791..3f435a3 100755 --- a/molteniron/tests/testDeallocateBM.py +++ b/molteniron/tests/testDeallocateBM.py @@ -21,8 +21,6 @@ Tests the MoltenIron deallocateBM command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse import json from molteniron import moltenirond diff --git a/molteniron/tests/testDeallocateOwner.py b/molteniron/tests/testDeallocateOwner.py index c469602..449ba44 100755 --- a/molteniron/tests/testDeallocateOwner.py +++ b/molteniron/tests/testDeallocateOwner.py @@ -21,8 +21,6 @@ Tests the MoltenIron deallocateOwner command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse import json from molteniron import moltenirond diff --git a/molteniron/tests/testDoClean.py b/molteniron/tests/testDoClean.py index 9590dae..b0613c1 100755 --- a/molteniron/tests/testDoClean.py +++ b/molteniron/tests/testDoClean.py @@ -21,8 +21,6 @@ Tests the MoltenIron doClean command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse from molteniron import moltenirond import os diff --git a/molteniron/tests/testGetField.py b/molteniron/tests/testGetField.py index 6a9b787..397ac1c 100755 --- a/molteniron/tests/testGetField.py +++ b/molteniron/tests/testGetField.py @@ -21,8 +21,6 @@ Tests the MoltenIron get_field command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse from molteniron import moltenirond import os diff --git a/molteniron/tests/testGetIps.py b/molteniron/tests/testGetIps.py index 6f0f8c1..1b7c344 100755 --- a/molteniron/tests/testGetIps.py +++ b/molteniron/tests/testGetIps.py @@ -21,8 +21,6 @@ Tests the MoltenIron get_ips command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse from molteniron import moltenirond import os diff --git a/molteniron/tests/testRemoveBMNode.py b/molteniron/tests/testRemoveBMNode.py index 38fa923..5fb63d5 100755 --- a/molteniron/tests/testRemoveBMNode.py +++ b/molteniron/tests/testRemoveBMNode.py @@ -21,8 +21,6 @@ Tests the MoltenIron removeBMNode command. # pylint: disable-msg=C0103 -from __future__ import print_function - import argparse from molteniron import moltenirond import os diff --git a/utils/createDB.py b/utils/createDB.py index 52a93bd..394a6cf 100755 --- a/utils/createDB.py +++ b/utils/createDB.py @@ -21,8 +21,6 @@ Create the MoltenIron user in mysql and grant it access. # pylint: disable-msg=C0103 -from __future__ import print_function - import os import sys import yaml diff --git a/utils/test_hook_mi_ipmiblob.py b/utils/test_hook_mi_ipmiblob.py index 0976b31..cafd130 100755 --- a/utils/test_hook_mi_ipmiblob.py +++ b/utils/test_hook_mi_ipmiblob.py @@ -23,8 +23,6 @@ a MoltenIron server. # pylint: disable-msg=C0103 # pylint: disable=redefined-outer-name -from __future__ import print_function - import argparse import json from molteniron import molteniron