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

@ -27,6 +27,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
leaf_profile: sw_name_test
state: present
register: leaf_profile_present
@ -65,12 +66,12 @@
that:
- sw_leaf_selec_check_mode_present.changed == true
- sw_leaf_selec_present.changed == true
- sw_leaf_selec_present.existing == []
- 'sw_leaf_selec_present.config == {"infraLeafS": {"attributes": {"name": "leaf_selector_name"}, "children": [{"infraNodeBlk": {"attributes": {"from_": "1011", "name": "node_blk_name", "to_": "1011"}}},{"infraRsAccNodePGrp": {"attributes": {"tDn": "uni/infra/funcprof/accnodepgrp-None"}}}]}}'
- sw_leaf_selec_present.previous == []
- 'sw_leaf_selec_present.sent == {"infraLeafS": {"attributes": {"name": "leaf_selector_name"}, "children": [{"infraNodeBlk": {"attributes": {"from_": "1011", "name": "node_blk_name", "to_": "1011"}}},{"infraRsAccNodePGrp": {"attributes": {"tDn": "uni/infra/funcprof/accnodepgrp-None"}}}]}}'
- sw_leaf_selec_idempotent.changed == false
- sw_leaf_selec_idempotent.config == {}
- sw_leaf_selec_idempotent.sent == {}
- sw_leaf_selec_update.changed == true
- 'sw_leaf_selec_update.config == {"infraLeafS": {"attributes": {},"children": [{"infraRsAccNodePGrp": {"attributes": {"tDn": "uni/infra/funcprof/accnodepgrp-anstest_policygroupname"}}}]}}'
- 'sw_leaf_selec_update.sent == {"infraLeafS": {"attributes": {},"children": [{"infraRsAccNodePGrp": {"attributes": {"tDn": "uni/infra/funcprof/accnodepgrp-anstest_policygroupname"}}}]}}'
- name: Query Specific switch policy leaf profile selector
aci_switch_leaf_selector:
@ -83,7 +84,7 @@
assert:
that:
- binding_query.changed == false
- binding_query.existing | length >= 1
- binding_query.previous | length >= 1
- '"api/mo/uni/infra/nprof-sw_name_test/leaves-leaf_selector_name-typ-range.json" in binding_query.url'
- name: Remove binding of interface access port selector and Interface Policy Leaf Profile - check mode
@ -116,11 +117,11 @@
assert:
that:
- sw_leaf_selec_check_mode_absent.changed == true
- sw_leaf_selec_check_mode_absent.existing != []
- sw_leaf_selec_check_mode_absent.previous != []
- sw_leaf_selec_absent.changed == true
- sw_leaf_selec_absent.existing == sw_leaf_selec_check_mode_absent.existing
- sw_leaf_selec_absent.previous == sw_leaf_selec_check_mode_absent.previous
- sw_leaf_selec_absent_idempotent.changed == false
- sw_leaf_selec_absent_idempotent.existing == []
- sw_leaf_selec_absent_idempotent.previous == []
- sw_leaf_selec_absent_missing_param.failed == true
- 'sw_leaf_selec_absent_missing_param.msg == "state is absent but all of the following are missing: leaf"'