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:
Nathaniel Case 2017-01-23 15:30:19 -05:00 committed by GitHub
parent cfed617dba
commit b3662fdad1
5 changed files with 348 additions and 91 deletions

View file

@ -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')