From 917736aebb80799d8b38c1a577bf53acd648e43c Mon Sep 17 00:00:00 2001 From: Bartek Date: Tue, 19 Jun 2018 08:28:30 +0200 Subject: Unintentional config changes in legacy xos, closes #1348 (#1362) --- lib/oxidized/model/xos.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/model/xos.rb b/lib/oxidized/model/xos.rb index 5ce8017..a589d0b 100644 --- a/lib/oxidized/model/xos.rb +++ b/lib/oxidized/model/xos.rb @@ -27,7 +27,7 @@ class XOS < Oxidized::Model end cmd 'show configuration' do |cfg| - cfg = cfg.each_line.reject { |line| line.match /^#(\s[\w]+\s)(Configuration generated)/ }.join + cfg = cfg.each_line.reject { |line| line.match /^#(\s[\w -]+\s)(Configuration generated)/ }.join cfg end @@ -41,7 +41,13 @@ class XOS < Oxidized::Model end cfg :telnet, :ssh do - post_login 'disable clipaging' + post_login do + data = cmd 'disable clipaging session' + match = data.match /^disable clipaging session\n\*?[\w .-]+(:\d+)? # $/m + next if match + cmd 'disable clipaging' + end + pre_logout do send "exit\n" send "n\n" -- cgit v1.2.1