diff options
Diffstat (limited to 'plugins/terminal/vyos.py')
-rw-r--r-- | plugins/terminal/vyos.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/terminal/vyos.py b/plugins/terminal/vyos.py index fe7712f..606f77b 100644 --- a/plugins/terminal/vyos.py +++ b/plugins/terminal/vyos.py @@ -40,7 +40,14 @@ class TerminalModule(TerminalBase): re.compile(br"\n\s+Set failed"), ] - terminal_length = os.getenv("ANSIBLE_VYOS_TERMINAL_LENGTH", 10000) + try: + terminal_length = os.getenv("ANSIBLE_VYOS_TERMINAL_LENGTH", 10000) + terminal_length = int(terminal_length) + except ValueError: + raise AnsibleConnectionFailure( + "Invalid value set for vyos terminal length '%s', value should be a valid integer string" + % terminal_length + ) def on_open_shell(self): try: |