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: Ieccdcdcec557efe480dcf3546299718b0baa37a4
This commit is contained in:
Hervé Beraud 2020-06-02 20:35:53 +02:00
parent 778ed750a0
commit a550ea1084
39 changed files with 0 additions and 73 deletions

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import array
from os_ken.base import app_manager

View File

@ -23,8 +23,6 @@
# --peers=sw1=localhost:1830:username:password
# (Cmd) raw_get sw1
from __future__ import print_function
import cmd
import sys

View File

@ -29,8 +29,6 @@
# NOTIFICATION from echo-server ['notify-method', ['param1', 'param2']]
# (Cmd)
from __future__ import print_function
import ast
import cmd
import signal

View File

@ -18,8 +18,6 @@
``ovs-vsctl`` command like library to speak OVSDB protocol
"""
from __future__ import print_function
import logging
import operator
import os

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import base64
import inspect

View File

@ -13,8 +13,6 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
from os_ken import cfg
import inspect
import platform

View File

@ -1,7 +1,5 @@
# flake8: noqa
from __future__ import absolute_import
from . import core
from . import operator
from . import prefix

View File

@ -18,7 +18,6 @@
This API can be used by various services like RPC, CLI, IoC, etc.
"""
from __future__ import absolute_import
import logging
import traceback

View File

@ -15,7 +15,6 @@
"""
Defines some base class related to managing green threads.
"""
from __future__ import absolute_import
import abc
from collections import OrderedDict

View File

@ -1,6 +1,4 @@
from __future__ import absolute_import
import os
from os_ken.services.protocols.bgp.bgpspeaker import RF_VPN_V4

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from .configuration_manager import ConfigurationManager
from .import_map_manager import ImportMapManager
from .peer_manager import PeerManager

View File

@ -1,4 +1,3 @@
from __future__ import absolute_import
from os_ken.services.protocols.bgp.base import ActivityException
from os_ken.services.protocols.bgp.operator.command import Command

View File

@ -1,4 +1,3 @@
from __future__ import absolute_import
import logging
import pprint

View File

@ -17,8 +17,6 @@
Database implementation for Zebra protocol service.
"""
from __future__ import absolute_import
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import functools
import logging

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
from sqlalchemy import Column

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
import socket

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
import sys
import unittest

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
import sys
import unittest

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import time
from os_ken.tests.integrated.common import docker_base as ctn_base

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import time
from os_ken.tests.integrated.common import docker_base as ctn_base

View File

@ -16,8 +16,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import itertools
import logging
import os

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
import os
import time

View File

@ -16,8 +16,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
import os

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
import os
import sys

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import unittest
from nose.tools import ok_, eq_, timed, nottest

View File

@ -110,8 +110,6 @@ Here is my sys.config used for this test.
"""
from __future__ import print_function
import traceback
import lxml.etree

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import time
import random

View File

@ -1,7 +1,5 @@
#! /usr/bin/env python
from __future__ import print_function
import getopt
import os
import re

View File

@ -1,4 +1,3 @@
from __future__ import absolute_import
# Note: The following import statement is defined in order to resolve
# the conflict of the module names between 'os_ken.lib.ovs' and 'ovs'.

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import six
import sys
import unittest

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import six
import sys
import unittest

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
try:
# Python 3
from functools import reduce

View File

@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import logging
import os
import sys

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import logging
import os
import sys

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import logging
import os
import sys

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import logging
import os
import sys

View File

@ -16,8 +16,6 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
from __future__ import print_function
import unittest
import logging
import six

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import os
import socket
import sys