ACI: Make querying links and nodes possible (#43441)

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)
This commit is contained in:
Dag Wieers 2018-08-07 23:54:54 +02:00 committed by GitHub
parent 529cd19ca5
commit d8ba8c03f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 1236 additions and 1052 deletions

View file

@ -42,7 +42,8 @@
#- name: Verify add_source
# assert:
# that:
# - cm_add_source.changed == nm_add_source.changed == true
# - cm_add_source is changed
# - nm_add_source is changed
# - 'cm_add_source.sent == nm_add_source.sent == {"firmwareOSource": {"attributes": {"name": "aci-msft-pkg-3.1.1i.zip", "proto": "http", "url": "foobar.cisco.com/download/cisco/aci/aci-msft-pkg-3.1.1i.zip"}}}'
# - 'cm_add_source.proposed == nm_add_source.proposed == {"firmwareOSource": {"attributes": {"name": "aci-msft-pkg-3.1.1i.zip", "proto": "http", "url": "foobar.cisco.com/download/cisco/aci/aci-msft-pkg-3.1.1i.zip"}}}'
# - cm_add_source.current == cm_add_source.previous == nm_add_source.previous == []
@ -62,7 +63,8 @@
#- name: Verify add_source_again
# assert:
# that:
# - cm_add_source_again.changed == nm_add_source_again.changed == false
# - cm_add_source_again is not changed
# - nm_add_source_again is not changed
# QUERY ALL SOURCES
@ -86,7 +88,8 @@
- name: Verify query_all_sources
assert:
that:
- cm_query_all_sources.changed == nm_query_all_sources.changed == false
- cm_query_all_sources is not changed
- nm_query_all_sources is not changed
- cm_query_all_sources == nm_query_all_sources
# - nm_query_all_sources.current|length >= 1
@ -108,7 +111,8 @@
#- name: Verify query_source
# assert:
# that:
# - cm_query_source.changed == nm_query_source.changed == false
# - cm_query_source is not changed
# - nm_query_source is not changed
# - cm_query_source == nm_query_source
# - nm_query_source.current.0.infraRsDomP.attributes.dn == 'uni/infra/attentp-test_aep/rsdomP-[uni/phys-phys_dom]'
# - nm_query_source.current.0.infraRsDomP.attributes.tCl == 'physDomP'
@ -128,7 +132,8 @@
#- name: Verify remove_source
# assert:
# that:
# - cm_remove_source.changed == nm_remove_source.changed == true
# - cm_remove_source is changed
# - nm_remove_source is changed
# - 'cm_remove_source.current == cm_remove_source.previous == nm_remove_source.previous == [{"infraRsDomP": {"attributes": {"dn": "uni/infra/attentp-test_aep/rsdomP-[uni/phys-phys_dom]", "tDn": "uni/phys-phys_dom"}}}]'
# - nm_remove_source.current == []
#
@ -144,7 +149,8 @@
#- name: Verify remove_source_again
# assert:
# that:
# - cm_remove_source_again.changed == nm_remove_source_again.changed == false
# - cm_remove_source_again is not changed
# - nm_remove_source_again is not changed
# QUERY NON-EXISTING SOURCE
@ -164,7 +170,8 @@
#- name: Verify query_non_source
# assert:
# that:
# - cm_query_non_source.changed == nm_query_non_source.changed == false
# - cm_query_non_source is not changed
# - nm_query_non_source is not changed
# - cm_query_non_source == nm_query_non_source
# - nm_query_non_source.current == []
@ -186,5 +193,5 @@
- name: Verify error_on_missing_required_param
assert:
that:
- error_on_missing_required_param.failed == true
- error_on_missing_required_param is failed
- 'error_on_missing_required_param.msg == "state is present but all of the following are missing: source, url"'