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) --- CHANGELOG.md | 1 + docs/Supported-OS-Types.md | 1 + lib/oxidized/model/xos.rb | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a6d98a..7d01b98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Master +* BUGFIX: xos model should not modify config on legacy Extreme Networks devices (sq9mev) * BUGFIX: model edgecos, ciscosmb * MISC: bump Dockerfile phusion/baseimage:0.10.0 -> 0.10.1 diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 067e0fd..59775ae 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -84,6 +84,7 @@ * [Enterasys](/lib/oxidized/model/enterasys.rb) * [WM](/lib/oxidized/model/mtrlrfs.rb) * [XOS](/lib/oxidized/model/xos.rb) + * [ExtremeWare](/lib/oxidized/model/xos.rb) * F5 * [TMOS](/lib/oxidized/model/tmos.rb) * Fiberstore 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