mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Os port fix (#24913)
* replace deprecated cmp() with custom conditional cmp is not present in Python3 but several modules use it Reference 24756
This commit is contained in:
parent
841baa3d5b
commit
1e4b227e6f
3 changed files with 3 additions and 4 deletions
|
@ -235,7 +235,7 @@ def setup_creation(client, module):
|
||||||
if endpoint['VpcId'] == vpc_id and endpoint['ServiceName'] == service_name:
|
if endpoint['VpcId'] == vpc_id and endpoint['ServiceName'] == service_name:
|
||||||
sorted_endpoint_rt_ids = sorted(endpoint['RouteTableIds'])
|
sorted_endpoint_rt_ids = sorted(endpoint['RouteTableIds'])
|
||||||
sorted_route_table_ids = sorted(route_table_ids)
|
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)
|
return False, camel_dict_to_snake_dict(endpoint)
|
||||||
|
|
||||||
changed, result = create_vpc_endpoint(client, module)
|
changed, result = create_vpc_endpoint(client, module)
|
||||||
|
|
|
@ -233,8 +233,7 @@ def _needs_update(module, port, cloud):
|
||||||
if module.params[key] is not None and module.params[key] != port[key]:
|
if module.params[key] is not None and module.params[key] != port[key]:
|
||||||
return True
|
return True
|
||||||
for key in compare_dict:
|
for key in compare_dict:
|
||||||
if module.params[key] is not None and cmp(module.params[key],
|
if module.params[key] is not None and module.params[key] != port[key]:
|
||||||
port[key]) != 0:
|
|
||||||
return True
|
return True
|
||||||
for key in compare_list:
|
for key in compare_list:
|
||||||
if module.params[key] is not None and (set(module.params[key]) !=
|
if module.params[key] is not None and (set(module.params[key]) !=
|
||||||
|
|
|
@ -223,7 +223,7 @@ class VMwareCluster(object):
|
||||||
self.cluster.configurationEx.drsConfig.enabled,
|
self.cluster.configurationEx.drsConfig.enabled,
|
||||||
self.cluster.configurationEx.vsanConfigInfo.enabled)
|
self.cluster.configurationEx.vsanConfigInfo.enabled)
|
||||||
|
|
||||||
if cmp(desired_state, current_state) != 0:
|
if desired_state != current_state:
|
||||||
return 'update'
|
return 'update'
|
||||||
else:
|
else:
|
||||||
return 'present'
|
return 'present'
|
||||||
|
|
Loading…
Reference in a new issue