mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00: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:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user