diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint.py index a5b60bcbf58..9273bf84978 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint.py @@ -235,7 +235,7 @@ def setup_creation(client, module): if endpoint['VpcId'] == vpc_id and endpoint['ServiceName'] == service_name: sorted_endpoint_rt_ids = sorted(endpoint['RouteTableIds']) sorted_route_table_ids = sorted(route_table_ids) - if cmp(sorted_endpoint_rt_ids, sorted_route_table_ids) == 0: + if sorted_endpoint_rt_ids == sorted_route_table_ids: return False, camel_dict_to_snake_dict(endpoint) changed, result = create_vpc_endpoint(client, module) diff --git a/lib/ansible/modules/cloud/openstack/os_port.py b/lib/ansible/modules/cloud/openstack/os_port.py index 04bbcd148ce..5fd6a63b98d 100644 --- a/lib/ansible/modules/cloud/openstack/os_port.py +++ b/lib/ansible/modules/cloud/openstack/os_port.py @@ -233,8 +233,7 @@ def _needs_update(module, port, cloud): if module.params[key] is not None and module.params[key] != port[key]: return True for key in compare_dict: - if module.params[key] is not None and cmp(module.params[key], - port[key]) != 0: + if module.params[key] is not None and module.params[key] != port[key]: return True for key in compare_list: if module.params[key] is not None and (set(module.params[key]) != diff --git a/lib/ansible/modules/cloud/vmware/vmware_cluster.py b/lib/ansible/modules/cloud/vmware/vmware_cluster.py index e9635897b0c..b21e135f062 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_cluster.py +++ b/lib/ansible/modules/cloud/vmware/vmware_cluster.py @@ -223,7 +223,7 @@ class VMwareCluster(object): self.cluster.configurationEx.drsConfig.enabled, self.cluster.configurationEx.vsanConfigInfo.enabled) - if cmp(desired_state, current_state) != 0: + if desired_state != current_state: return 'update' else: return 'present'