diff options
author | Chris Van Heuveln <cvanheuv@cisco.com> | 2019-06-06 06:22:55 -0400 |
---|---|---|
committer | Trishna Guha <trishnaguha17@gmail.com> | 2019-06-06 15:52:55 +0530 |
commit | 7aa0d26fda4de063e0e03694a6df65f5ed7ff790 (patch) | |
tree | a067bf276acc156d8e70b95d4535a0e532eff294 /test/integration/targets/prepare_nxos_tests | |
parent | f65ac2cf23d9628030d873d4b593b10752502232 (diff) | |
download | ansible-7aa0d26fda4de063e0e03694a6df65f5ed7ff790.tar.gz |
nxos_bfd_global / NxosCmdRef initial commit (#56317)
* nxos_bfd_global: initial commit
This is an initial POC with just a few commands included. The code has been written somewhat generically so that it can act as a best practices template for re-use in future modules. The implementation follows the yaml cmd_ref style to define each command's getter/setter/type/default. It supports platform-specific defaults.
The basic logic is to collect all relevant data in a `cmd_ref` dict and pass that around to various methods.
In the BFD case the devices don't provide JSON output so we have to screen-scrape with show runs.
BFD does not support present/absent states so there is no state param.
BFD has three different property types to handle. We can add add'l types as needed:
- int
- int_list (list of ints)
- str (needs support for 'no' keyword)
* Use get_capabilities to find platform type
* PR comment fixes, round 1
* Minor cleanups
* nxos_bfd_global: create NxosCmdRef in module_utils
This commit just takes the latest bfd global code and moves the bulk
of the code into new `class NxosCmdRef` in `module_utils/nxos/nxos.py`.
The only remaining code in `nxos_bfd_global.py` are the calls from `main()`.
* Add remaining command properties and documentation
* update argument_spec
* Add check for _exclude; add sanity test
* Add targets files for bfd
* Context and state absent updates
* Add dict support to cmd_ref
* Changed remaining list commands to dict usage
* Add idempotence check for dict
* Fix existing overwrite bug
* Move pattern matching logic into its own method
* add support for 'command: absent'
* Add `get_platform_shortname`; update BFD platform-specific settings
* /absent/deleted/
* /sh/show/ in prepare_nxos_tests
* add dict check to get_platform_shortname
* Add normalize_defaults()
* UTs for bfd_global
* support yaml for both py2/py3
* update cmd_ref doc header
* Fix python2.6 incompatibility with dict comprehensions
* Fix bfd_global doc header (yaml syntax fail)
* more shippable fixes
* yet more shippable fixes
* shippable: remove r' ' wrappers
* docfix - remove ':'
* escape regex ctl chars in yaml table
* remove extra blank lines
* Fix str(None) issue
* Command context updates
* import PY2,PY3 instead of import sys
* fix ordereddict import & parent_context
* try/except for yaml import
* fix import issue for ordereddict
* remove epdb
* nxosCmdRef_import_check() workaround for shippable
* fix PEP ws errors
Diffstat (limited to 'test/integration/targets/prepare_nxos_tests')
-rw-r--r-- | test/integration/targets/prepare_nxos_tests/tasks/main.yml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/integration/targets/prepare_nxos_tests/tasks/main.yml b/test/integration/targets/prepare_nxos_tests/tasks/main.yml index 5d7ab5ed8d..ff91587187 100644 --- a/test/integration/targets/prepare_nxos_tests/tasks/main.yml +++ b/test/integration/targets/prepare_nxos_tests/tasks/main.yml @@ -43,7 +43,7 @@ # Get image version information for this device - name: "Gather image version info" nxos_command: - commands: ['sh version | json'] + commands: ['show version | json'] connection: network_cli register: nxos_version_output @@ -58,7 +58,7 @@ # - name: "Gather platform info" nxos_command: - commands: ['sh inventory | json'] + commands: ['show inventory | json'] connection: network_cli register: nxos_inventory_output |