This functionality was not considered when the module was written, but
there's no reason why it shouldn't be supported.
We had to rework the query string construction and object filtering.
This new functionality allows to filter on arbitrary keys and supports
None values.
This PR fixes various issues with the existing framework, including
querying specific objects using construct_url_4 (i.e.
aci_epg_to_contract and aci_static_binding_to_epg)
- 'update_static.sent == {"fvnsVlanInstP": {"attributes": {"descr": "Ansible Test Change"}}}'
- 'update_static.sent == {"fvnsVlanInstP": {"attributes": {"descr": "Ansible Test Change"}}}'
- name:update dynamic vlan pool - update works
- name:update dynamic vlan pool - update works
@ -103,7 +103,7 @@
- name:assertion test - present
- name:assertion test - present
assert:
assert:
that:
that:
- update_dynamic.changed == true
- update_dynamic is changed
- 'update_dynamic.sent == {"fvnsVlanInstP": {"attributes": {"descr": "Ansible Test Change"}}}'
- 'update_dynamic.sent == {"fvnsVlanInstP": {"attributes": {"descr": "Ansible Test Change"}}}'
- name:missing param - failure message works
- name:missing param - failure message works
@ -116,7 +116,7 @@
- name:assertion test - present
- name:assertion test - present
assert:
assert:
that:
that:
- vlan_alloc_fail.failed == true
- vlan_alloc_fail is failed
- "vlan_alloc_fail.msg == 'ACI requires parameter \\'pool_allocation_mode\\' for \\'pool_type\\' of \\'vlan\\' and \\'vsan\\' when parameter \\'pool\\' is provided'"
- "vlan_alloc_fail.msg == 'ACI requires parameter \\'pool_allocation_mode\\' for \\'pool_type\\' of \\'vlan\\' and \\'vsan\\' when parameter \\'pool\\' is provided'"
- name:missing param - failure message works
- name:missing param - failure message works
@ -129,7 +129,7 @@
- name:assertion test - present
- name:assertion test - present
assert:
assert:
that:
that:
- vlan_pool_fail.failed == true
- vlan_pool_fail is failed
- 'vlan_pool_fail.msg == "state is present but all of the following are missing: pool"'
- 'vlan_pool_fail.msg == "state is present but all of the following are missing: pool"'
- name:missing required param - error message works
- name:missing required param - error message works
aci_encap_pool_range:
aci_encap_pool_range:
@ -187,8 +187,8 @@
- name:present assertions
- name:present assertions
assert:
assert:
that:
that:
- range_present_missing_param.failed == true
- range_present_missing_param is failed
- 'range_present_missing_param.msg == "state is present but all of the following are missing: range_end, range_name, range_start"'
- "range_present_missing_param.msg == 'state is present but all of the following are missing: range_end, range_name, range_start'"
- name:missing required param - error message works
- name:missing required param - error message works
aci_encap_pool_range:
aci_encap_pool_range:
@ -200,8 +200,8 @@
- name:present assertions
- name:present assertions
assert:
assert:
that:
that:
- range_present_allocation.failed == true
- range_present_allocation is failed
- 'range_present_allocation.msg == "ACI requires the \"pool_allocation_mode\" for \"pool_type\" of \"vlan\" and \"vsan\" when the \"pool\" is provided"'
- range_present_allocation.msg == 'ACI requires the "pool_allocation_mode" for "pool_type" of "vlan" and "vsan" when the "pool" is provided'
- "error_on_name_resolution.msg == 'Connection failed for https://foo.bar.cisco.com/api/aaaLogin.json. Request failed: <urlopen error [Errno -2] Name or service not known>'"
- "error_on_name_resolution.msg == 'Connection failed for https://foo.bar.cisco.com/api/aaaLogin.json. Request failed: <urlopen error [Errno -2] Name or service not known>'"
- "'current' not in error_on_missing_required_param"
- "'current' not in error_on_missing_required_param"
- "'previous' not in error_on_missing_required_param"
- "'previous' not in error_on_missing_required_param"
@ -82,7 +82,7 @@
- name:Verify error_on_missing_attributes
- name:Verify error_on_missing_attributes
assert:
assert:
that:
that:
- error_on_missing_attributes.failed == true
- error_on_missing_attributes is failed
- error_on_missing_attributes.method == 'POST'
- error_on_missing_attributes.method == 'POST'
- "error_on_missing_attributes.msg == 'APIC Error 400: invalid data at line \\'1\\'. Attributes are missing, tag \\'attributes\\' must be specified first, before any other tag'"
- "error_on_missing_attributes.msg == 'APIC Error 400: invalid data at line \\'1\\'. Attributes are missing, tag \\'attributes\\' must be specified first, before any other tag'"
- 'error_on_missing_attributes.response == "HTTP Error 400: Bad Request"'
- 'error_on_missing_attributes.response == "HTTP Error 400: Bad Request"'
@ -115,7 +115,7 @@
- name:Verify error_on_input_validation
- name:Verify error_on_input_validation
assert:
assert:
that:
that:
- error_on_input_validation.failed == true
- error_on_input_validation is failed
- error_on_input_validation.method == 'POST'
- error_on_input_validation.method == 'POST'
- "error_on_input_validation.msg == 'APIC Error 801: property descr of tn-ansible_test failed validation for value \\'This is an [invalid] description\\''"
- "error_on_input_validation.msg == 'APIC Error 801: property descr of tn-ansible_test failed validation for value \\'This is an [invalid] description\\''"
- 'error_on_input_validation.response == "HTTP Error 400: Bad Request"'
- 'error_on_input_validation.response == "HTTP Error 400: Bad Request"'
@ -148,7 +148,7 @@
- name:Verify error_on_invalid_attributes
- name:Verify error_on_invalid_attributes
assert:
assert:
that:
that:
- error_on_invalid_attributes.failed == true
- error_on_invalid_attributes is failed
- error_on_invalid_attributes.method == 'POST'
- error_on_invalid_attributes.method == 'POST'
- "error_on_invalid_attributes.msg == 'APIC Error 400: unknown attribute \\'description\\' in element \\'fvTenant\\''"
- "error_on_invalid_attributes.msg == 'APIC Error 400: unknown attribute \\'description\\' in element \\'fvTenant\\''"
- 'error_on_invalid_attributes.response == "HTTP Error 400: Bad Request"'
- 'error_on_invalid_attributes.response == "HTTP Error 400: Bad Request"'