From 20eed2e40303a80b3d4cd444fb358041bb9c2b60 Mon Sep 17 00:00:00 2001 From: Martin Pels Date: Tue, 3 Mar 2015 11:26:59 +0100 Subject: fixes for EOS switches with enable secret configured --- lib/oxidized/model/eos.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/oxidized/model/eos.rb b/lib/oxidized/model/eos.rb index 1b43221..98a8c28 100644 --- a/lib/oxidized/model/eos.rb +++ b/lib/oxidized/model/eos.rb @@ -2,12 +2,12 @@ class EOS < Oxidized::Model # Arista EOS model # - prompt /^([\w.@()-]+[#>]\s?)$/ + prompt /^.+[#>]\s?$/ comment '! ' cmd :all do |cfg| - cfg.each_line.to_a[2..-2].join + cfg.each_line.to_a[1..-2].join end cmd :secret do |cfg| @@ -28,10 +28,14 @@ class EOS < Oxidized::Model if vars :enable post_login do send "enable\n" + expect /[pP]assword:\s?$/ send vars(:enable) + "\n" + expect /^.+[#>]\s?$/ end + post_login 'terminal length 0' end pre_logout 'exit' end end + -- cgit v1.2.1