Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft 3957 #143

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
- stable-2.11
- stable-2.12
- stable-2.13
- devel
- stable-2.14
- stable-2.15
runs-on: ubuntu-latest
steps:

Expand All @@ -21,10 +22,10 @@ jobs:
with:
path: ansible_collections/dellemc/os10

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand All @@ -33,4 +34,4 @@ jobs:
run: ansible-galaxy collection install ansible.netcommon -p ../../

- name: Run sanity tests
run: ansible-test sanity --docker -v --color --python 3.8
run: ansible-test sanity --docker -v --color --python 3.9
1 change: 1 addition & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
requires_ansible: '>=2.9.10'
plugin_routing:
action:
os10_config:
Expand Down
4 changes: 2 additions & 2 deletions plugins/module_utils/network/os10.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

from __future__ import (absolute_import, division, print_function)

import re
# import re

from ansible.module_utils._text import to_text
from ansible.module_utils.basic import env_fallback
Expand All @@ -56,7 +56,7 @@
'username': dict(fallback=(env_fallback, ['ANSIBLE_NET_USERNAME'])),
'password': dict(fallback=(env_fallback, ['ANSIBLE_NET_PASSWORD']), no_log=True),
'ssh_keyfile': dict(fallback=(env_fallback, ['ANSIBLE_NET_SSH_KEYFILE']), type='path'),
'authorize': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTHORIZE']), type='bool'),
'authorize': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTHORIZE']), type='bool', default='false'),
'auth_pass': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTH_PASS']), no_log=True),
'timeout': dict(type='int'),
}
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/bgp_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
description:
- show ip bgp summary output
type: 'list'
elements: 'dict'
required: True
show_ip_intf_brief:
description:
- show ip interface brief output
type: 'list'
elements: 'dict'
required: True
bgp_neighbors:
description:
- planned neighbours input from group_var to compare actual
type: 'list'
elements: 'dict'
required: True
'''
EXAMPLES = '''
Expand Down Expand Up @@ -93,14 +96,17 @@ def get_fields(self):
spec_fields = {
'show_ip_bgp': {
'type': 'list',
'elements': 'dict',
'required': True
},
'show_ip_intf_brief': {
'type': 'list',
'elements': 'dict',
'required': True
},
'bgp_neighbors': {
'type': 'list',
'elements': 'dict',
'required': True
}
}
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/mtu_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
description:
- show lldp neighbor output
type: 'list'
elements: 'dict'
required: True
show_system_network_summary:
description:
- show system network summary output
type: 'list'
elements: 'dict'
required: True
show_ip_intf_brief:
description:
- show ip intf brief
type: 'list'
elements: 'dict'
required: True
'''
EXAMPLES = '''
Expand Down Expand Up @@ -94,14 +97,17 @@ def get_fields(self):
spec_fields = {
'show_lldp_neighbors_list': {
'type': 'list',
'elements': 'dict',
'required': True
},
'show_system_network_summary': {
'type': 'list',
'elements': 'dict',
'required': True
},
'show_ip_intf_brief': {
'type': 'list',
'elements': 'dict',
'required': True
}
}
Expand Down
21 changes: 21 additions & 0 deletions plugins/modules/os10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import (absolute_import, division, print_function)
__copyright__ = "(c) 2020 Dell Inc. or its subsidiaries. All rights reserved."
__metaclass__ = type

DOCUMENTATION = '''
module: os10
author: "Senthil Kumar Ganesan (@skg-net)"
short_description: created this file to resolve action plugin has no matching module to provide documentation error.
description:
- solve the action plugin has no matching module to provide documentation error.
'''

EXAMPLES = '''
Copy below YAML into a playbook (e.g. play.yml) and run follows:

#$ ansible-playbook -i inv play.yml
'''
4 changes: 3 additions & 1 deletion plugins/modules/os10_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
module is not returned until the condition is satisfied or
the number of retries has expired.
type: list
elements: str
required: true
wait_for:
description:
Expand Down Expand Up @@ -167,7 +168,8 @@ def main():
"""
argument_spec = dict(
# { command: <str>, prompt: <str>, response: <str> }
commands=dict(type='list', required=True),
# commands=dict(type='list', required=True),
commands=dict(type='list', required=True, elements='str'),

wait_for=dict(type='list', elements='str'),
match=dict(default='all', choices=['all', 'any']),
Expand Down
14 changes: 9 additions & 5 deletions plugins/modules/os10_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
command syntax as some commands are automatically modified by the
device config parser. This argument is mutually exclusive with I(src).
type: list
elements: str
aliases: ['commands']
parents:
description:
Expand All @@ -42,6 +43,7 @@
is omitted, the commands are checked against the set of top
level or global commands.
type: list
elements: str
src:
description:
- Specifies the source path to the file that contains the configuration
Expand All @@ -58,13 +60,15 @@
any changes without affecting how the set of commands are matched
against the system.
type: list
elements: str
after:
description:
- The ordered set of commands to append to the end of the command
stack if a change needs to be made. Just like with I(before) this
allows the playbook designer to append a set of commands to be
executed after the command set.
type: list
elements: str
match:
description:
- Instructs the module on the way to perform the matching of
Expand Down Expand Up @@ -211,7 +215,7 @@
from ansible_collections.dellemc.os10.plugins.module_utils.network.os10 import get_config, get_sublevel_config
from ansible_collections.dellemc.os10.plugins.module_utils.network.os10 import os10_argument_spec, check_args
from ansible_collections.dellemc.os10.plugins.module_utils.network.os10 import load_config, run_commands
from ansible_collections.dellemc.os10.plugins.module_utils.network.os10 import WARNING_PROMPTS_RE
# from ansible_collections.dellemc.os10.plugins.module_utils.network.os10 import WARNING_PROMPTS_RE
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.config import NetworkConfig, dumps


Expand Down Expand Up @@ -245,13 +249,13 @@ def main():
dir_path=dict(type='path')
)
argument_spec = dict(
lines=dict(aliases=['commands'], type='list'),
parents=dict(type='list'),
lines=dict(aliases=['commands'], type='list', elements='str'),
parents=dict(type='list', elements='str'),

src=dict(type='path'),

before=dict(type='list'),
after=dict(type='list'),
before=dict(type='list', elements='str'),
after=dict(type='list', elements='str'),

match=dict(default='line',
choices=['line', 'strict', 'exact', 'none']),
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/os10_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
with an initial C(!) to specify that a specific subset should
not be collected.
type: list
elements: str
default: [ '!config' ]
"""

Expand Down Expand Up @@ -439,7 +440,8 @@ def main():
"""main entry point for module execution
"""
argument_spec = dict(
gather_subset=dict(default=['!config'], type='list')
# gather_subset=dict(default=['!config'], type='list')
gather_subset=dict(default=['!config'], type='list', elements='str')
)

argument_spec.update(os10_argument_spec)
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/show_system_network_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
required: False
cli_responses:
type: list
elements: 'dict'
required: True
description:
- show system command xml output
Expand Down Expand Up @@ -61,7 +62,7 @@
- debug: var=show_system_network_summary
'''

import re
# import re
from ansible_collections.dellemc.os10.plugins.module_utils.network.base_network_show import BaseNetworkShow


Expand All @@ -76,6 +77,7 @@ def get_fields(self):
spec_fields = {
'cli_responses': {
'type': 'list',
'elements': 'dict',
'required': True
},
'output_type': {
Expand Down
21 changes: 21 additions & 0 deletions plugins/modules/textfsm_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import (absolute_import, division, print_function)
__copyright__ = "(c) 2020 Dell Inc. or its subsidiaries. All rights reserved."
__metaclass__ = type

DOCUMENTATION = '''
module: textfsm_parser
author: "Senthil Kumar Ganesan (@skg-net)"
short_description: created this file to resolve action plugin has no matching module to provide documentation error.
description:
- solve the action plugin has no matching module to provide documentation error.
'''

EXAMPLES = '''
Copy below YAML into a playbook (e.g. play.yml) and run follows:

#$ ansible-playbook -i inv play.yml
'''
6 changes: 6 additions & 0 deletions plugins/modules/vlt_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
description:
- show vlt output
type: 'list'
elements: 'dict'
required: True
show_system_network_summary:
description:
- show system summary output
type: 'list'
elements: 'dict'
required: True
intended_vlt_pairs:
description:
- intended vlt pair intput to verify with actual
type: 'list'
elements: 'dict'
required: True

'''
Expand Down Expand Up @@ -103,14 +106,17 @@ def get_fields(self):
spec_fields = {
'show_vlt': {
'type': 'list',
'elements': 'dict',
'required': True
},
'show_system_network_summary': {
'type': 'list',
'elements': 'dict',
'required': True
},
'intended_vlt_pairs': {
'type': 'list',
'elements': 'dict',
'required': True
}
}
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/wiring_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
description:
- show lldp neighbor output
type: 'list'
elements: 'dict'
required: True
show_system_network_summary:
description:
- show system network summary output
type: 'list'
elements: 'dict'
required: True
planned_neighbors:
description:
- planned neighbours input from group_var to compare actual
type: 'list'
elements: 'dict'
required: True
'''
EXAMPLES = '''
Expand Down Expand Up @@ -86,14 +89,17 @@ def get_fields(self):
spec_fields = {
'show_lldp_neighbors_list': {
'type': 'list',
'elements': 'dict',
'required': True
},
'show_system_network_summary': {
'type': 'list',
'elements': 'dict',
'required': True
},
'planned_neighbors': {
'type': 'list',
'elements': 'dict',
'required': True
}
}
Expand Down Expand Up @@ -212,7 +218,7 @@ def perform_action(self):
planned_neighbors["reason"] = reason
planned_neighbors["error_type"] = "link-mismatch"
break
if(actual_neighbors["dest_port"] != planned_neighbors["dest_port"]):
if (actual_neighbors["dest_port"] != planned_neighbors["dest_port"]):
bflag = True
reason = (
"Destination switch port is not an expected value, "
Expand Down
20 changes: 0 additions & 20 deletions tests/sanity/ignore-2.10.txt

This file was deleted.

Loading