Skip to content

Commit

Permalink
Bug fixes to handle privilege level, idempotency etc
Browse files Browse the repository at this point in the history
  • Loading branch information
komalupatil authored Dec 10, 2020
1 parent c9a425a commit e79f77e
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 11 deletions.
10 changes: 10 additions & 0 deletions changelogs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Ansible Network Collection for Dell EMC OS6 Release Notes

.. contents:: Topics

v1.0.5
======

Bugfixes
---------------

- config module fix to handle issues faced while parsing running config and fixing idempotency issue for banner config
- command module change to keep similar changes across all dell networking OSs
- terminal plugin fix to send "terminal length 0" command

v1.0.4
======

Expand Down
10 changes: 9 additions & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@ releases:
fragments:
- 1.0.4.yaml
release_date: "2020-11-17"

1.0.5:
changes:
bugfixes:
- config module fix to handle issues faced while parsing running config and fixing idempotency issue for banner config
- command module change to keep similar changes across all dell networking OSs
- terminal plugin fix to send "terminal length 0" command
fragments:
- 1.0.5.yaml
release_date: "2020-12-09"
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: dellemc
name: os6
version: 1.0.4
version: 1.0.5
readme: README.md
authors:
- Komal Patil <[email protected]>
Expand Down
1 change: 0 additions & 1 deletion plugins/doc_fragments/os6.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class ModuleDocFragment(object):
task, the value of environment variable C(ANSIBLE_NET_AUTHORIZE) will be
used instead.
type: bool
default: false
auth_pass:
description:
- Specifies the password to use if required to enter privileged mode on the
Expand Down
10 changes: 5 additions & 5 deletions plugins/module_utils/network/os6.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_sublevel_config(running_config, module):

def os6_parse(lines, indent=None, comment_tokens=None):
sublevel_cmds = [
re.compile(r'^vlan !(priority).*$'),
re.compile(r'^vlan\s[\d,-]+.*$'),
re.compile(r'^stack.*$'),
re.compile(r'^interface.*$'),
re.compile(r'datacenter-bridging.*$'),
Expand All @@ -150,23 +150,23 @@ def os6_parse(lines, indent=None, comment_tokens=None):
re.compile(r'ipv6 (dhcp pool|router).*$'),
re.compile(r'mail-server.*$'),
re.compile(r'vpc domain.*$'),
re.compile(r'router.*$'),
re.compile(r'router\s.*$'),
re.compile(r'route-map.*$'),
re.compile(r'policy-map.*$'),
re.compile(r'class-map match-all.*$'),
re.compile(r'captive-portal.*$'),
re.compile(r'admin-profile.*$'),
re.compile(r'link-dependency group.*$'),
re.compile(r'banner motd.*$'),
re.compile(r'openflow.*$'),
re.compile(r'support-assist.*$'),
re.compile(r'template.*$'),
re.compile(r'address-family.*$'),
re.compile(r'spanning-tree mst configuration.*$'),
re.compile(r'logging (?!.*(cli-command|buffered|console|email|facility|file|monitor|protocol|snmp|source-interface|traps|web-session)).*$'),
re.compile(r'(radius-server|tacacs-server) host.*$')]
re.compile(r'radius server (?!.*(attribute|dead-criteria|deadtime|timeout|key|load-balance|retransmit|source-interface|source-ip|vsa)).*$'),
re.compile(r'(tacacs-server) host.*$')]

childline = re.compile(r'^exit$')
childline = re.compile(r'^exit\s*$')
config = list()
parent = list()
children = []
Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/os6_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
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 @@ -165,7 +164,7 @@ def main():
"""
argument_spec = dict(
# { command: <str>, prompt: <str>, response: <str> }
commands=dict(type='list', elements='str', required=True),
commands=dict(type='list', required=True),

wait_for=dict(type='list', elements='str'),
match=dict(default='all', choices=['all', 'any']),
Expand Down
7 changes: 7 additions & 0 deletions plugins/terminal/os6.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ class TerminalModule(TerminalBase):

terminal_inital_prompt_newline = False

def on_open_shell(self):
try:
if self._get_prompt().endswith(b'#'):
self._exec_cli_command(b'terminal length 0')
except AnsibleConnectionFailure:
raise AnsibleConnectionFailure('unable to set terminal parameters')

def on_become(self, passwd=None):
if self._get_prompt().endswith(b'#'):
return
Expand Down
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.10.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins/action/os6.py action-plugin-docs
plugins/modules/os6_config.py validate-modules:parameter-list-no-elements
plugins/modules/os6_facts.py validate-modules:parameter-list-no-elements
plugins/modules/os6_command.py validate-modules:parameter-list-no-elements
3 changes: 2 additions & 1 deletion tests/sanity/ignore-2.11.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins/action/os6.py action-plugin-docs
plugins/modules/os6_config.py validate-modules:parameter-list-no-elements
plugins/modules/os6_facts.py validate-modules:parameter-list-no-elements
plugins/modules/os6_facts.py validate-modules:parameter-list-no-elements
plugins/modules/os6_command.py validate-modules:parameter-list-no-elements

0 comments on commit e79f77e

Please sign in to comment.