You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units/modules/network
Chris Van Heuveln 7aa0d26fda 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
6 years ago
..
aireos Update bare exceptions to specify Exception. 6 years ago
aruba Update bare exceptions to specify Exception. 6 years ago
asa ASA network/service object-group module (#52925) 6 years ago
basics code clean of old code from network modules updates (#21469) 8 years ago
checkpoint Add checkpoint_session module (#50930) 6 years ago
cli Add backup parameter to cli_config (#50206) 6 years ago
cloudvision Ensure that current uses of BaseException are required 6 years ago
cnos The module fails on switchport. Check added to fix. (#54970) 6 years ago
cumulus Remove wildcard import in test_nclu 7 years ago
dellos6 Update bare exceptions to specify Exception. 6 years ago
dellos9 Update bare exceptions to specify Exception. 6 years ago
dellos10 Update bare exceptions to specify Exception. 6 years ago
edgeos Update bare exceptions to specify Exception. 6 years ago
edgeswitch new network module: edgeswitch_vlan (#48041) 6 years ago
enos Update bare exceptions to specify Exception. 6 years ago
eos New module for BGP configuration management in Arista EOS (#52722) 6 years ago
exos Exos httpapi (#54405) 6 years ago
f5 Rename _facts -> _info (#57028) 6 years ago
fortimanager FortiManager Plugin Module Conversion: fmgr_ha (#52768) 6 years ago
frr frr: New module for BGP configuration management (#51281) 6 years ago
ftd Add latest updates from FTD Ansible downstream repository. (#53638) 6 years ago
ingate modules: network: ingate: Add module ig_store_edit (#47675) 6 years ago
ios Revert nxos, ios, iosxr return_timestamps (#56206) 6 years ago
iosxr Revert nxos, ios, iosxr return_timestamps (#56206) 6 years ago
ironware Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 6 years ago
itential itential iap_start_workflow module (#51238) 6 years ago
junos Add platform facts in network facts modules (#51434) 6 years ago
netact Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
netscaler Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
netvisor Pluribus Networks ipv6security raguard port module with UT (#57033) 6 years ago
nos Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 6 years ago
nso NSO - added validate_certs parameter to allow for ignoring of SSL certificates (#51981) 6 years ago
nuage Replace nose with pytest 6 years ago
nxos nxos_bfd_global / NxosCmdRef initial commit (#56317) 6 years ago
onyx Adding New Model onyx_qos for Configuring QoS on Onyx Switches (#55127) 6 years ago
opx opx_cps_changes (#51952) 6 years ago
ovs Add support for vlan update on ovs bridges (#57168) 6 years ago
radware Changing the license to Apache 2 6 years ago
routeros Update bare exceptions to specify Exception. 6 years ago
slxos Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 6 years ago
voss Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 6 years ago
vyos Add platform facts in network facts modules (#51434) 6 years ago
__init__.py adds new module net_command for network devices (#19468) 8 years ago