TPT-4614: Remove Python 2 compatibility code - #853
Open
zliang-akamai wants to merge 4 commits into
Open
Conversation
zliang-akamai
requested review from
jbilskiAkam and
mawilk90
and removed request for
a team
August 17, 2026 00:02
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes legacy Python 2 compatibility constructs from the linode.cloud Ansible collection’s plugin code, aligning modules and helpers with the collection’s Python 3-only support target.
Changes:
- Removed legacy
from __future__ import absolute_import, division, print_functionlines across collection modules and module_utils. - Removed the inventory plugin’s module-level
__metaclass__ = typedeclaration (Python 2 compatibility). - Kept behavior intentionally unchanged (cleanup-only refactor).
Reviewed changes
Copilot reviewed 136 out of 136 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/modules/vpcs_ipv6_list.py | Remove Python 2 __future__ import. |
| plugins/modules/vpcs_ip_list.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_subnet.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_subnet_list.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_subnet_info.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_list.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_ipv6_list.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_ip_list.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_info.py | Remove Python 2 __future__ import. |
| plugins/modules/vpc_default_ranges_info.py | Remove Python 2 __future__ import. |
| plugins/modules/volume.py | Remove Python 2 __future__ import. |
| plugins/modules/volume_type_list.py | Remove Python 2 __future__ import. |
| plugins/modules/volume_list.py | Remove Python 2 __future__ import. |
| plugins/modules/volume_info.py | Remove Python 2 __future__ import. |
| plugins/modules/vlan_list.py | Remove Python 2 __future__ import. |
| plugins/modules/vlan_info.py | Remove Python 2 __future__ import. |
| plugins/modules/user.py | Remove Python 2 __future__ import. |
| plugins/modules/user_list.py | Remove Python 2 __future__ import. |
| plugins/modules/user_info.py | Remove Python 2 __future__ import. |
| plugins/modules/type_list.py | Remove Python 2 __future__ import. |
| plugins/modules/type_info.py | Remove Python 2 __future__ import. |
| plugins/modules/token.py | Remove Python 2 __future__ import. |
| plugins/modules/token_list.py | Remove Python 2 __future__ import. |
| plugins/modules/token_info.py | Remove Python 2 __future__ import. |
| plugins/modules/stackscript.py | Remove Python 2 __future__ import. |
| plugins/modules/stackscript_list.py | Remove Python 2 __future__ import. |
| plugins/modules/stackscript_info.py | Remove Python 2 __future__ import. |
| plugins/modules/ssh_key.py | Remove Python 2 __future__ import. |
| plugins/modules/ssh_key_list.py | Remove Python 2 __future__ import. |
| plugins/modules/ssh_key_info.py | Remove Python 2 __future__ import. |
| plugins/modules/region_vpc_availability_list.py | Remove Python 2 __future__ import. |
| plugins/modules/region_list.py | Remove Python 2 __future__ import. |
| plugins/modules/region_info.py | Remove Python 2 __future__ import. |
| plugins/modules/profile_info.py | Remove Python 2 __future__ import. |
| plugins/modules/placement_group.py | Remove Python 2 __future__ import. |
| plugins/modules/placement_group_list.py | Remove Python 2 __future__ import. |
| plugins/modules/placement_group_info.py | Remove Python 2 __future__ import. |
| plugins/modules/placement_group_assign.py | Remove Python 2 __future__ import. |
| plugins/modules/object_storage_quota_list.py | Remove Python 2 __future__ import. |
| plugins/modules/object_storage_quota_info.py | Remove Python 2 __future__ import. |
| plugins/modules/object_storage_global_quota_list.py | Remove Python 2 __future__ import. |
| plugins/modules/object_storage_global_quota_info.py | Remove Python 2 __future__ import. |
| plugins/modules/object_storage_endpoint_list.py | Remove Python 2 __future__ import. |
| plugins/modules/object_keys.py | Remove Python 2 __future__ import. |
| plugins/modules/object_cluster_list.py | Remove Python 2 __future__ import. |
| plugins/modules/object_cluster_info.py | Remove Python 2 __future__ import. |
| plugins/modules/nodebalancer.py | Remove Python 2 __future__ import. |
| plugins/modules/nodebalancer_type_list.py | Remove Python 2 __future__ import. |
| plugins/modules/nodebalancer_stats.py | Remove Python 2 __future__ import. |
| plugins/modules/nodebalancer_node.py | Remove Python 2 __future__ import. |
| plugins/modules/nodebalancer_list.py | Remove Python 2 __future__ import. |
| plugins/modules/nodebalancer_info.py | Remove Python 2 __future__ import. |
| plugins/modules/network_transfer_prices_list.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_services_alert_definition.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_services_alert_definition_list.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_services_alert_definition_info.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_services_alert_definition_by_service_type_list.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_stream.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_stream_list.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_stream_info.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_stream_history.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_destination.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_destination_list.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_destination_info.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_logs_destination_history.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_alert_definition_entities_list.py | Remove Python 2 __future__ import. |
| plugins/modules/monitor_alert_channel_list.py | Remove Python 2 __future__ import. |
| plugins/modules/maintenance_policy_list.py | Remove Python 2 __future__ import. |
| plugins/modules/lock.py | Remove Python 2 __future__ import. |
| plugins/modules/lock_list.py | Remove Python 2 __future__ import. |
| plugins/modules/lock_info.py | Remove Python 2 __future__ import. |
| plugins/modules/lke_version_list.py | Remove Python 2 __future__ import. |
| plugins/modules/lke_version_info.py | Remove Python 2 __future__ import. |
| plugins/modules/lke_type_list.py | Remove Python 2 __future__ import. |
| plugins/modules/lke_cluster.py | Remove Python 2 __future__ import. |
| plugins/modules/lke_cluster_info.py | Remove Python 2 __future__ import. |
| plugins/modules/ipv6_range_info.py | Remove Python 2 __future__ import. |
| plugins/modules/ip.py | Remove Python 2 __future__ import. |
| plugins/modules/ip_share.py | Remove Python 2 __future__ import. |
| plugins/modules/ip_rdns.py | Remove Python 2 __future__ import. |
| plugins/modules/ip_info.py | Remove Python 2 __future__ import. |
| plugins/modules/ip_assign.py | Remove Python 2 __future__ import. |
| plugins/modules/instance.py | Remove Python 2 __future__ import. |
| plugins/modules/instance_type_list.py | Remove Python 2 __future__ import. |
| plugins/modules/instance_list.py | Remove Python 2 __future__ import. |
| plugins/modules/instance_interface_settings.py | Remove Python 2 __future__ import. |
| plugins/modules/instance_interface_settings_info.py | Remove Python 2 __future__ import. |
| plugins/modules/instance_interface_firewall_list.py | Remove Python 2 __future__ import. |
| plugins/modules/instance_info.py | Remove Python 2 __future__ import. |
| plugins/modules/image.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_token.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_token_list.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_token_info.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_member.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_member_list.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_member_info.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_list.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_info.py | Remove Python 2 __future__ import. |
| plugins/modules/image_share_group_image_list.py | Remove Python 2 __future__ import. |
| plugins/modules/image_list.py | Remove Python 2 __future__ import. |
| plugins/modules/image_info.py | Remove Python 2 __future__ import. |
| plugins/modules/firewall.py | Remove Python 2 __future__ import. |
| plugins/modules/firewall_template_list.py | Remove Python 2 __future__ import. |
| plugins/modules/firewall_template_info.py | Remove Python 2 __future__ import. |
| plugins/modules/firewall_settings.py | Remove Python 2 __future__ import. |
| plugins/modules/firewall_settings_info.py | Remove Python 2 __future__ import. |
| plugins/modules/firewall_list.py | Remove Python 2 __future__ import. |
| plugins/modules/firewall_info.py | Remove Python 2 __future__ import. |
| plugins/modules/event_list.py | Remove Python 2 __future__ import. |
| plugins/modules/domain.py | Remove Python 2 __future__ import. |
| plugins/modules/domain_record.py | Remove Python 2 __future__ import. |
| plugins/modules/domain_record_info.py | Remove Python 2 __future__ import. |
| plugins/modules/domain_list.py | Remove Python 2 __future__ import. |
| plugins/modules/domain_info.py | Remove Python 2 __future__ import. |
| plugins/modules/database_postgresql_v2.py | Remove Python 2 __future__ import. |
| plugins/modules/database_postgresql_info.py | Remove Python 2 __future__ import. |
| plugins/modules/database_mysql_v2.py | Remove Python 2 __future__ import. |
| plugins/modules/database_mysql_info.py | Remove Python 2 __future__ import. |
| plugins/modules/database_list.py | Remove Python 2 __future__ import. |
| plugins/modules/database_engine_list.py | Remove Python 2 __future__ import. |
| plugins/modules/database_config_info.py | Remove Python 2 __future__ import. |
| plugins/modules/consumer_image_share_group_info.py | Remove Python 2 __future__ import. |
| plugins/modules/consumer_image_share_group_image_list.py | Remove Python 2 __future__ import. |
| plugins/modules/child_account_list.py | Remove Python 2 __future__ import. |
| plugins/modules/child_account_info.py | Remove Python 2 __future__ import. |
| plugins/modules/api_request.py | Remove Python 2 __future__ import. |
| plugins/modules/account_settings.py | Remove Python 2 __future__ import. |
| plugins/modules/account_info.py | Remove Python 2 __future__ import. |
| plugins/modules/account_availability_list.py | Remove Python 2 __future__ import. |
| plugins/modules/account_availability_info.py | Remove Python 2 __future__ import. |
| plugins/module_utils/linode_common.py | Remove Python 2 __future__ import in shared base utilities. |
| plugins/module_utils/linode_common_list.py | Remove Python 2 __future__ import in shared list helpers. |
| plugins/module_utils/linode_common_info.py | Remove Python 2 __future__ import in shared info helpers. |
| plugins/inventory/instance.py | Remove Python 2 __future__ import and module-level __metaclass__ compat line. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mawilk90
requested review from
lgarber-akamai
and removed request for
jbilskiAkam
August 17, 2026 08:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Remove obsolete Python 2 compatibility code across the collection plugins. This deletes legacy
__future__imports and the inventory module's__metaclass__declaration now that the collection targets Python 3. No runtime behavior changes are intended.