mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
vyos_command 2.3 (#18994)
* Peter's new module_utils/vyos * Update vyos_command * Restore `set terminal length $ANSIBLE_VYOS_TERMINAL_LENGTH` in vyos * vyos_command tests * Remove provider mentions from vyos_command * Extend get_config to take (and cache) various `show configuration` commands
This commit is contained in:
parent
cfed617dba
commit
b3662fdad1
5 changed files with 348 additions and 91 deletions
|
@ -19,6 +19,7 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from ansible.plugins.terminal import TerminalBase
|
||||
|
@ -38,9 +39,12 @@ class TerminalModule(TerminalBase):
|
|||
re.compile(r"\n\s+Set failed"),
|
||||
]
|
||||
|
||||
terminal_length = os.getenv('ANSIBLE_VYOS_TERMINAL_LENGTH', 10000)
|
||||
|
||||
def on_open_shell(self):
|
||||
try:
|
||||
self._exec_cli_command('set terminal length 0')
|
||||
self._exec_cli_command('set terminal length %s' % self.terminal_length)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue