ACI: Cleanup deprecated boolean behaviour (#55207)

* ACI: Cleanup deprecated boolean behaviour

* Remove from sanity ignore list
pull/55378/head
Dag Wieers 6 years ago committed by GitHub
parent 521e62aa38
commit 9495ddbc21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -141,23 +141,6 @@ class ACIModule(object):
elif value is False: elif value is False:
return false return false
# When we expect value is of type=raw, deprecate in Ansible v2.8 (and all modules use type=bool)
try:
# This supports all Ansible boolean types
bool_value = boolean(value)
if bool_value is True:
return true
elif bool_value is False:
return false
except Exception:
# This provides backward compatibility to Ansible v2.4, deprecate in Ansible v2.8
if value == true:
self.module.deprecate("Boolean value '%s' is no longer valid, please use 'yes' as a boolean value." % value, '2.9')
return true
elif value == false:
self.module.deprecate("Boolean value '%s' is no longer valid, please use 'no' as a boolean value." % value, '2.9')
return false
# If all else fails, escalate back to user # If all else fails, escalate back to user
self.module.fail_json(msg="Boolean value '%s' is an invalid ACI boolean value.") self.module.fail_json(msg="Boolean value '%s' is an invalid ACI boolean value.")

@ -297,7 +297,7 @@ def main():
encap=dict(type='int'), encap=dict(type='int'),
encap_mode=dict(type='str', choices=['auto', 'vlan', 'vxlan']), encap_mode=dict(type='str', choices=['auto', 'vlan', 'vxlan']),
epg=dict(type='str', aliases=['name', 'epg_name']), # Not required for querying all objects epg=dict(type='str', aliases=['name', 'epg_name']), # Not required for querying all objects
netflow=dict(type='raw'), # Turn into a boolean in v2.9 netflow=dict(type='bool'),
primary_encap=dict(type='int'), primary_encap=dict(type='int'),
resolution_immediacy=dict(type='str', choices=['immediate', 'lazy', 'pre-provision']), resolution_immediacy=dict(type='str', choices=['immediate', 'lazy', 'pre-provision']),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']),

@ -196,7 +196,7 @@ def main():
description=dict(type='str', aliases=['descr']), description=dict(type='str', aliases=['descr']),
vlan_scope=dict(type='str', choices=['global', 'portlocal']), # No default provided on purpose vlan_scope=dict(type='str', choices=['global', 'portlocal']), # No default provided on purpose
qinq=dict(type='str', choices=['core', 'disabled', 'edge']), qinq=dict(type='str', choices=['core', 'disabled', 'edge']),
vepa=dict(type='raw'), # Turn into a boolean in v2.9 vepa=dict(type='bool'),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
) )

@ -182,8 +182,8 @@ def main():
argument_spec.update( argument_spec.update(
lldp_policy=dict(type='str', aliases=['name']), # Not required for querying all objects lldp_policy=dict(type='str', aliases=['name']), # Not required for querying all objects
description=dict(type='str', aliases=['descr']), description=dict(type='str', aliases=['descr']),
receive_state=dict(type='raw'), # Turn into a boolean in v2.9 receive_state=dict(type='bool'),
transmit_state=dict(type='raw'), # Turn into a boolean in v2.9 transmit_state=dict(type='bool'),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
) )

@ -176,7 +176,7 @@ def main():
argument_spec.update( argument_spec.update(
mcp=dict(type='str', aliases=['mcp_interface', 'name']), # Not required for querying all objects mcp=dict(type='str', aliases=['mcp_interface', 'name']), # Not required for querying all objects
description=dict(type='str', aliases=['descr']), description=dict(type='str', aliases=['descr']),
admin_state=dict(type='raw'), # Turn into a boolean in v2.9 admin_state=dict(type='bool'),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
) )

@ -189,7 +189,7 @@ def main():
argument_spec.update( argument_spec.update(
tenant=dict(type='str', aliases=['tenant_name']), # Not required for querying all objects tenant=dict(type='str', aliases=['tenant_name']), # Not required for querying all objects
src_group=dict(type='str', aliases=['name']), # Not required for querying all objects src_group=dict(type='str', aliases=['name']), # Not required for querying all objects
admin_state=dict(type='raw'), # Turn into a boolean in v2.9 admin_state=dict(type='bool'),
description=dict(type='str', aliases=['descr']), description=dict(type='str', aliases=['descr']),
dst_group=dict(type='str'), dst_group=dict(type='str'),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']),

@ -397,11 +397,6 @@ lib/ansible/modules/net_tools/basics/uri.py E323
lib/ansible/modules/net_tools/basics/uri.py E326 lib/ansible/modules/net_tools/basics/uri.py E326
lib/ansible/modules/network/a10/a10_server_axapi3.py E326 lib/ansible/modules/network/a10/a10_server_axapi3.py E326
lib/ansible/modules/network/a10/a10_virtual_server.py E324 lib/ansible/modules/network/a10/a10_virtual_server.py E324
lib/ansible/modules/network/aci/aci_epg_to_domain.py E325
lib/ansible/modules/network/aci/aci_interface_policy_l2.py E325
lib/ansible/modules/network/aci/aci_interface_policy_lldp.py E325
lib/ansible/modules/network/aci/aci_interface_policy_mcp.py E325
lib/ansible/modules/network/aci/aci_tenant_span_src_group.py E325
lib/ansible/modules/network/asa/asa_config.py E324 lib/ansible/modules/network/asa/asa_config.py E324
lib/ansible/modules/network/asa/asa_config.py E335 lib/ansible/modules/network/asa/asa_config.py E335
lib/ansible/modules/network/bigswitch/bigmon_policy.py E324 lib/ansible/modules/network/bigswitch/bigmon_policy.py E324

Loading…
Cancel
Save