summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoransible-zuul[bot] <48994755+ansible-zuul[bot]@users.noreply.github.com>2020-03-07 11:55:32 +0000
committerGitHub <noreply@github.com>2020-03-07 11:55:32 +0000
commit77e8b041b2983415ac36eb6264f6e385ac87b074 (patch)
tree895a9e9ffb82c924629aa62e9276f19b06d69e8f
parent3f112a81a78f499d105632b4634d7feec0401161 (diff)
parentcdfed725635e5eb9a54549c122c9657f09a967ea (diff)
downloadvyos-ansible-old-77e8b041b2983415ac36eb6264f6e385ac87b074.tar.gz
vyos-ansible-old-77e8b041b2983415ac36eb6264f6e385ac87b074.zip
Merge pull request #8 from ganeshrn/vyos_terminal_fix
Fix vyos terminal length issue Reviewed-by: https://github.com/apps/ansible-zuul
-rw-r--r--plugins/terminal/vyos.py9
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: