mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Set terminal width for network *_command modules to avoid paging (#23728)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
47edac6ebd
commit
f354bd1eab
6 changed files with 10 additions and 6 deletions
|
@ -48,7 +48,8 @@ class TerminalModule(TerminalBase):
|
|||
|
||||
def on_open_shell(self):
|
||||
try:
|
||||
self._exec_cli_command('terminal length 0')
|
||||
for cmd in ['terminal length 0', 'terminal width 512']:
|
||||
self._exec_cli_command(cmd)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
||||
|
|
|
@ -46,7 +46,8 @@ class TerminalModule(TerminalBase):
|
|||
|
||||
def on_open_shell(self):
|
||||
try:
|
||||
self._exec_cli_command('terminal length 0')
|
||||
for cmd in ['terminal length 0', 'terminal width 512']:
|
||||
self._exec_cli_command(cmd)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class TerminalModule(TerminalBase):
|
|||
|
||||
def on_open_shell(self):
|
||||
try:
|
||||
for cmd in ['terminal length 0', 'terminal exec prompt no-timestamp']:
|
||||
for cmd in ['terminal length 0', 'terminal width 512', 'terminal exec prompt no-timestamp']:
|
||||
self._exec_cli_command(cmd)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
|
|
@ -49,7 +49,7 @@ class TerminalModule(TerminalBase):
|
|||
if prompt.strip().endswith('%'):
|
||||
display.vvv('starting cli', self._connection._play_context.remote_addr)
|
||||
self._exec_cli_command('cli')
|
||||
for c in ['set cli timestamp disable', 'set cli screen-length 0']:
|
||||
for c in ['set cli timestamp disable', 'set cli screen-length 0', 'set cli screen-width 1024']:
|
||||
self._exec_cli_command(c)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
|
|
@ -48,7 +48,8 @@ class TerminalModule(TerminalBase):
|
|||
|
||||
def on_open_shell(self):
|
||||
try:
|
||||
self._exec_cli_command('terminal length 0')
|
||||
for cmd in ['terminal length 0', 'terminal width 511']:
|
||||
self._exec_cli_command(cmd)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ class TerminalModule(TerminalBase):
|
|||
|
||||
def on_open_shell(self):
|
||||
try:
|
||||
self._exec_cli_command('set terminal length 0')
|
||||
for cmd in ['set terminal length 0', 'set terminal width 512']:
|
||||
self._exec_cli_command(cmd)
|
||||
self._exec_cli_command('set terminal length %s' % self.terminal_length)
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
|
Loading…
Reference in a new issue