community.general/lib/ansible/module_utils
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
2019-06-06 15:52:55 +05:30
..
aws Aws waf region (#48953) 2019-05-17 10:36:14 +10:00
common removed_module func: removed extra spaces from msg and docstring (#57209) 2019-06-03 10:00:19 -04:00
compat Do not look for a paramiko compat package anymore (#55106) 2019-04-10 14:51:53 -04:00
csharp Ansible.Basic - fix when deserialising a json string of an array (#55691) 2019-05-01 11:08:23 +10:00
distro Update bundled copy of distro from 1.3.0 to 1.4.0 (#55459) 2019-04-23 11:52:51 -05:00
docker [docker] support the lookup of images by digest (#56649) 2019-05-21 02:54:05 -04:00
facts update pkg_mgr.py for Amazon Linux support (#56618) 2019-05-30 10:18:31 +02:00
k8s Fix #56640: Map k8s ansible keys to api keys (#57418) 2019-06-06 18:51:23 +10:00
net_tools PR to fix the bug 57215 & 56300 under Nios Host_Record module (#57221) 2019-06-04 10:52:16 +05:30
network nxos_bfd_global / NxosCmdRef initial commit (#56317) 2019-06-06 15:52:55 +05:30
oracle Initial commit for Oracle Cloud Infrastructure modules 2019-05-14 13:51:45 -07:00
parsing
podman Add podman_image and podman_image_info modules (#55103) 2019-04-10 18:28:09 -05:00
powershell Bump deps for ntlm-auth and PSScriptAnalyzer (#55269) 2019-04-16 06:43:41 +10:00
remote_management as per IRC Core team comment, renaming pwd to password (#55033) 2019-04-11 12:56:48 +01:00
six Update bundled copy of six from 1.11.0 to 1.12.0 (#55456) 2019-04-23 11:53:25 -05:00
source_control Add Bitbucket Pipelines variable module (#54049) 2019-03-22 13:17:08 +01:00
storage Ansible module to enable the user to provision CPGs on HPE StoreServ 3PAR device (#39656) 2019-02-26 14:09:03 +00:00
__init__.py
_text.py
acme.py crypto modules: use module_utils.compat.ipaddress when possible (#55278) 2019-04-18 15:36:53 +01:00
alicloud_ecs.py
ansible_release.py
ansible_tower.py standardize TLS connection properties (#54315) 2019-03-28 00:19:28 -05:00
api.py
azure_rm_common.py Fix the get property (#55745) 2019-04-26 10:07:58 +08:00
azure_rm_common_ext.py azure_rm_azurefirewall (#56359) 2019-05-20 10:38:55 -07:00
azure_rm_common_rest.py
basic.py Revert nxos, ios, iosxr return_timestamps (#56206) 2019-05-08 20:49:29 +05:30
cloud.py
cloudscale.py cloudscale_server: refactor to implement update (#52683) 2019-03-05 10:40:16 +01:00
cloudstack.py cloudstack: fix E326 (#54657) 2019-03-31 23:36:56 +02:00
connection.py Fix spelling error in connection (#54957) 2019-04-12 16:53:59 -04:00
crypto.py openssl_certificate: fix passphrase handling for cryptography backend (#56155) 2019-05-07 23:58:15 -04:00
database.py postgresql_db: added tablespace support (#56390) 2019-05-16 12:13:40 +02:00
digital_ocean.py
dimensiondata.py Final round of moving modules to new import error msg (#51852) 2019-02-08 10:07:01 +10:00
ec2.py Fix _hashable_policy for python3 (#53953) 2019-03-18 09:40:28 -05:00
exoscale.py
f5_utils.py
firewalld.py
gcdns.py
gce.py
gcp.py
gcp_utils.py Bug fixes for GCP modules (#54765) 2019-04-03 13:31:08 -04:00
gitlab.py copyright: edit deprecated email (#51912) 2019-02-08 01:48:25 +01:00
hcloud.py Add hcloud server module (#53062) 2019-03-05 07:30:24 +01:00
heroku.py Final round of moving modules to new import error msg (#51852) 2019-02-08 10:07:01 +10:00
hetzner.py Hetzner failover IP: refactoring (#56203) 2019-05-10 08:33:51 +02:00
hwc_utils.py refactor moudule utils of hwc_utils.py (#55858) 2019-05-09 09:04:51 -04:00
ibm_sa_utils.py IBM_Storage: fixed a bug - Unwanted arguments cause failure (#56357) 2019-05-13 12:41:06 -04:00
infinibox.py
influxdb.py Sanity fixes to parameter types (#52325) 2019-02-15 16:58:58 +01:00
ipa.py identity: Issue warning if GSSAPI parameters can't be used (#52721) 2019-02-22 08:39:42 +00:00
ismount.py
json_utils.py
keycloak.py New module: keycloak_group (#35637) 2019-04-10 15:58:20 -04:00
known_hosts.py
kubevirt.py kubevirt: Rewrite merge dict method 2019-05-30 07:41:21 -07:00
ldap.py
linode.py
lxd.py
manageiq.py standardize TLS connection properties (#54315) 2019-03-28 00:19:28 -05:00
memset.py
mysql.py New module mysql_info - Gather information about MySQL servers (#55434) 2019-05-28 09:10:12 +02:00
netapp.py Added eseries base with tests (#49269) 2019-03-08 18:13:45 +00:00
netapp_elementsw_module.py
netapp_module.py New Options for Autosupport (#50773) 2019-01-23 18:18:07 +00:00
oneandone.py
oneview.py Use common functions for handling import errors (#51851) 2019-02-07 16:51:16 -05:00
online.py
opennebula.py
openstack.py Handle openstacksdk < 0.10.0: fix AttributeError (#50285) 2019-05-24 10:27:47 -05:00
ovirt.py ovirt: Resolve also list of hrefs (#57299) 2019-06-06 10:58:26 +02:00
postgres.py postgresql: remove depricated lib (#56641) 2019-05-24 15:08:16 -04:00
pure.py
pycompat24.py
rabbitmq.py standardize TLS connection properties (#54315) 2019-03-28 00:19:28 -05:00
rax.py standardize TLS connection properties (#54315) 2019-03-28 00:19:28 -05:00
redfish_utils.py redfish: refactor service_root variable (#56198) 2019-05-23 10:57:22 +02:00
redhat.py
scaleway.py Add a Scaleway load-balancer module (#51741) 2019-02-11 15:28:55 +00:00
service.py
splitter.py
univention_umc.py
urls.py cert validation fixes - Attempt 2 (#55953) 2019-05-31 16:35:25 -04:00
utm_utils.py Add optional headers to utm modules (#49856) 2019-01-17 19:06:50 +05:30
vca.py standardize TLS connection properties (#54315) 2019-03-28 00:19:28 -05:00
vexata.py New module for managing volumes in Vexata storage arrays (#49006) 2019-04-10 21:12:23 +05:30
vmware.py VMware: vcenter_folder: print full path of the new folder (#55237) 2019-05-23 16:21:22 +05:30
vmware_rest_client.py VMware: Modifying Rest Client to use vSphere-Api-Client instead of individual service(#55804) 2019-05-09 18:19:42 +05:30
vultr.py vultr: streamline docs (#56563) 2019-05-20 14:52:37 -05:00
xenserver.py XenServer: Minor bug fixes 2 (#54697) 2019-04-08 12:27:02 -04:00
yumdnf.py Allow all of yum version compare operators (#54603) 2019-04-08 10:34:21 +02:00