Browse Source

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: I088f435bfc0dfeb67b4b2c3400aaa08eb41d7c59
changes/63/732963/1
Hervé Beraud 2 years ago
parent
commit
c09f624891
  1. 2
      tripleo_ansible/ansible_plugins/action/tripleo_nova_image_cache.py
  2. 2
      tripleo_ansible/ansible_plugins/callback/tripleo.py
  3. 1
      tripleo_ansible/ansible_plugins/callback/tripleo_dense.py
  4. 1
      tripleo_ansible/ansible_plugins/callback/tripleo_profile_tasks.py
  5. 4
      tripleo_ansible/ansible_plugins/modules/baremetal_nodes_validate.py
  6. 4
      tripleo_ansible/ansible_plugins/modules/baremetal_register_or_update_nodes.py
  7. 2
      tripleo_ansible/ansible_plugins/modules/container_config_data.py
  8. 2
      tripleo_ansible/ansible_plugins/modules/container_puppet_config.py
  9. 2
      tripleo_ansible/ansible_plugins/modules/metalsmith_instances.py
  10. 4
      tripleo_ansible/ansible_plugins/modules/os_baremetal_clean_node.py
  11. 4
      tripleo_ansible/ansible_plugins/modules/os_baremetal_node_info.py
  12. 4
      tripleo_ansible/ansible_plugins/modules/os_baremetal_provide_node.py
  13. 4
      tripleo_ansible/ansible_plugins/modules/os_tripleo_baremetal_node_introspection.py
  14. 4
      tripleo_ansible/ansible_plugins/modules/paunch.py
  15. 2
      tripleo_ansible/ansible_plugins/modules/podman_container.py
  16. 2
      tripleo_ansible/ansible_plugins/modules/podman_container_info.py
  17. 2
      tripleo_ansible/ansible_plugins/modules/podman_volume_info.py
  18. 2
      tripleo_ansible/ansible_plugins/modules/tripleo_baremetal_check_existing.py
  19. 2
      tripleo_ansible/ansible_plugins/modules/tripleo_baremetal_expand_roles.py
  20. 2
      tripleo_ansible/ansible_plugins/modules/tripleo_baremetal_populate_environment.py
  21. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_config_download.py
  22. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_fernet_keys_rotate.py
  23. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_generate_ansible_inventory.py
  24. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_generate_overcloudrc.py
  25. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_image_params_prepare.py
  26. 2
      tripleo_ansible/ansible_plugins/modules/tripleo_nova_image_cache.py
  27. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_passwords_rotate.py
  28. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_plan_deploy.py
  29. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_plan_parameters_update.py
  30. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_swift_tempurl.py
  31. 4
      tripleo_ansible/ansible_plugins/modules/tripleo_templates_upload.py
  32. 2
      tripleo_ansible/ansible_plugins/strategy/tripleo_base.py
  33. 2
      tripleo_ansible/ansible_plugins/strategy/tripleo_free.py
  34. 2
      tripleo_ansible/ansible_plugins/strategy/tripleo_linear.py
  35. 2
      tripleo_ansible/roles/tripleo_ovs_dpdk/library/openvswitch_db.py

2
tripleo_ansible/ansible_plugins/action/tripleo_nova_image_cache.py

@ -13,8 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
__metaclass__ = type
import hashlib

2
tripleo_ansible/ansible_plugins/callback/tripleo.py

@ -12,8 +12,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import constants as C

1
tripleo_ansible/ansible_plugins/callback/tripleo_dense.py

@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import uuid

1
tripleo_ansible/ansible_plugins/callback/tripleo_profile_tasks.py

@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import time

4
tripleo_ansible/ansible_plugins/modules/baremetal_nodes_validate.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ansible.module_utils.basic import AnsibleModule
from tripleo_common import exception

4
tripleo_ansible/ansible_plugins/modules/baremetal_register_or_update_nodes.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

2
tripleo_ansible/ansible_plugins/modules/container_config_data.py

@ -14,8 +14,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule

2
tripleo_ansible/ansible_plugins/modules/container_puppet_config.py

@ -14,8 +14,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule

2
tripleo_ansible/ansible_plugins/modules/metalsmith_instances.py

@ -13,8 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
__metaclass__ = type
from concurrent import futures

4
tripleo_ansible/ansible_plugins/modules/os_baremetal_clean_node.py

@ -15,10 +15,6 @@
# under the License.
# flake8: noqa: E501
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__metaclass__ = type

4
tripleo_ansible/ansible_plugins/modules/os_baremetal_node_info.py

@ -15,10 +15,6 @@
# under the License.
# flake8: noqa: E501
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__metaclass__ = type

4
tripleo_ansible/ansible_plugins/modules/os_baremetal_provide_node.py

@ -15,10 +15,6 @@
# under the License.
# flake8: noqa: E501
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__metaclass__ = type

4
tripleo_ansible/ansible_plugins/modules/os_tripleo_baremetal_node_introspection.py

@ -13,10 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',

4
tripleo_ansible/ansible_plugins/modules/paunch.py

@ -12,10 +12,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule

2
tripleo_ansible/ansible_plugins/modules/podman_container.py

@ -16,8 +16,6 @@
# flake8: noqa: E501
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import json

2
tripleo_ansible/ansible_plugins/modules/podman_container_info.py

@ -12,8 +12,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import, division, print_function
__metaclass__ = type

2
tripleo_ansible/ansible_plugins/modules/podman_volume_info.py

@ -14,8 +14,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {

2
tripleo_ansible/ansible_plugins/modules/tripleo_baremetal_check_existing.py

@ -13,8 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
__metaclass__ = type
from ansible.module_utils import baremetal_deploy as bd

2
tripleo_ansible/ansible_plugins/modules/tripleo_baremetal_expand_roles.py

@ -13,8 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
__metaclass__ = type
from ansible.module_utils import baremetal_deploy as bd

2
tripleo_ansible/ansible_plugins/modules/tripleo_baremetal_populate_environment.py

@ -13,8 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
__metaclass__ = type
from ansible.module_utils import baremetal_deploy as bd

4
tripleo_ansible/ansible_plugins/modules/tripleo_config_download.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_fernet_keys_rotate.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_generate_ansible_inventory.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_generate_overcloudrc.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_image_params_prepare.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

2
tripleo_ansible/ansible_plugins/modules/tripleo_nova_image_cache.py

@ -13,8 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule

4
tripleo_ansible/ansible_plugins/modules/tripleo_passwords_rotate.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_plan_deploy.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_plan_parameters_update.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_swift_tempurl.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

4
tripleo_ansible/ansible_plugins/modules/tripleo_templates_upload.py

@ -15,10 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from ansible.module_utils import tripleo_common_utils as tc

2
tripleo_ansible/ansible_plugins/strategy/tripleo_base.py

@ -12,8 +12,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError

2
tripleo_ansible/ansible_plugins/strategy/tripleo_free.py

@ -12,8 +12,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os

2
tripleo_ansible/ansible_plugins/strategy/tripleo_linear.py

@ -12,8 +12,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os

2
tripleo_ansible/roles/tripleo_ovs_dpdk/library/openvswitch_db.py

@ -5,8 +5,6 @@
# (c) 2015, Mark Hamilton <mhamilton@vmware.com>
# Portions copyright @ 2015 VMware, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

Loading…
Cancel
Save