ACI: Change RETURN output as discussed (#35617)

* ACI: Change result output as discussed

* Update all modules to use new aci.exit_json()

* Update output_level spec and docs

* Fix integration tests

* Small PEP8 fix

* Asorted fixes to tests and aci_rest

* More test fixes and support for ANSIBLE_DEBUG

* Fix another PEP8 issues

* Move response handling inside ACI module

* Reform of ACI error handling and error output

* Diff multiline json output

* Fix a few more tests

* Revert aci_bd tests

* Small correction

* UI change: existing->current, original->previous

* UI change: config->sent

* Update all modules with RETURN values

* Fix a few more tests

* Improve docstring and add 'raw' return value

* Fix thinko

* Fix sanity/pep8 issues

* Rewrite unit tests to comply with new design
This commit is contained in:
Dag Wieers 2018-02-03 00:41:56 +01:00 committed by GitHub
commit bee765fa6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 5733 additions and 747 deletions

View file

@ -16,6 +16,7 @@
validate_certs: '{{ aci_validate_certs | default(false) }}'
use_ssl: '{{ aci_use_ssl | default(true) }}'
use_proxy: '{{ aci_use_proxy | default(true) }}'
output_level: debug
state: present
tenant: anstest
register: tenant_present
@ -93,20 +94,20 @@
assert:
that:
- create_check_mode.changed == true
- 'create_check_mode.config == {"fvSubnet": {"attributes": {"descr": "Ansible Test", "ip": "10.100.100.1/24", "name": "anstest"}}}'
- 'create_check_mode.sent == {"fvSubnet": {"attributes": {"descr": "Ansible Test", "ip": "10.100.100.1/24", "name": "anstest"}}}'
- create_subnet.changed == true
- 'create_subnet.config == {"fvSubnet": {"attributes": {"descr": "Ansible Test", "ip": "10.100.100.1/24", "name": "anstest"}}}'
- 'create_subnet.existing == []'
- 'create_subnet.sent == {"fvSubnet": {"attributes": {"descr": "Ansible Test", "ip": "10.100.100.1/24", "name": "anstest"}}}'
- 'create_subnet.previous == []'
- create_subnet2.changed == true
- create_subnet2.config == create_subnet2.proposed
- 'create_subnet2.config.fvSubnet.attributes.scope == "private,shared"'
- 'create_subnet2.config.fvSubnet.children.0.fvRsBDSubnetToProfile.attributes == {"tnL3extOutName": "default", "tnRtctrlProfileName": "default"}'
- create_subnet2.sent == create_subnet2.proposed
- 'create_subnet2.sent.fvSubnet.attributes.scope == "private,shared"'
- 'create_subnet2.sent.fvSubnet.children.0.fvRsBDSubnetToProfile.attributes == {"tnL3extOutName": "default", "tnRtctrlProfileName": "default"}'
- create_idempotency.changed == false
- create_idempotency.existing != []
- create_idempotency.previous != []
- modify_subnet.changed == true
- modify_subnet.existing != []
- modify_subnet.previous != []
- modify_subnet.changed != modify_subnet.proposed
- 'modify_subnet.config == {"fvSubnet": {"attributes": {"ctrl": "querier", "scope": "public,shared"}}}'
- 'modify_subnet.sent == {"fvSubnet": {"attributes": {"ctrl": "querier", "scope": "public,shared"}}}'
- create_bad_scope.failed == true
- 'create_bad_scope.msg.startswith("value of scope must be one of")'
- create_incomplete_data.failed == true
@ -169,7 +170,7 @@
assert:
that:
- get_all.changed == false
- get_all.existing | length > 1
- get_all.previous | length > 1
- get_all_tenant.changed == false
- '"tn-anstest.json" in get_all_tenant.url'
- get_all_bd.changed == false
@ -177,7 +178,7 @@
- '"class/fvBD.json" in get_all_bd.url'
- get_all_tenant_bd.changed == false
- '"tn-anstest/BD-anstest.json" in get_all_tenant_bd.url'
- get_all_tenant_bd.existing.0.fvBD.children | length > 1
- get_all_tenant_bd.previous.0.fvBD.children | length > 1
- get_subnet_tenant.changed == false
- '"rsp-subtree-filter=eq(fvSubnet.ip, \"10.100.100.1/24\")" in get_subnet_tenant.filter_string'
- '"tn-anstest.json" in get_subnet_tenant.url'
@ -185,7 +186,7 @@
- '"query-target-filter=eq(fvBD.name, \"anstest\")" and "rsp-subtree-filter=eq(fvSubnet.ip, \"10.100.100.1/24\")" in get_subnet_bd.filter_string'
- '"class/fvBD.json" in get_subnet_bd.url'
- get_subnet.changed == false
- get_subnet.existing | length == 1
- get_subnet.previous | length == 1
- '"tn-anstest/BD-anstest/subnet-[10.100.100.1/24].json" in get_subnet.url'
- get_subnets_gateway.changed == false
- '"query-target-filter=eq(fvSubnet.ip, \"10.100.100.1/24\")" in get_subnets_gateway.filter_string'
@ -217,10 +218,10 @@
- delete_check_mode.changed == true
- delete_check_mode.proposed == {}
- delete_subnet.changed == true
- delete_subnet.existing != []
- delete_subnet.previous != []
- 'delete_subnet.method == "DELETE"'
- delete_idempotency.changed == false
- delete_idempotency.existing == []
- delete_idempotency.previous == []
- name: delete bd - cleanup before ending tests
aci_bd: