diff options
author | Saku Ytti <saku@ytti.fi> | 2013-10-24 12:48:53 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2013-10-24 12:48:53 +0300 |
commit | 0060d65fb92c2e09ec04e6bccb25f53338b71d0a (patch) | |
tree | 8d22c80d4ff36a1bc18d275d60e71020bd02b1c6 /lib/oxidized/model/ios.rb | |
parent | 1b4cf651d5b7e9e032a7bc0636c569d0419f2ded (diff) | |
parent | edaf887b86d84378c94ef02fe7200e70f93f9279 (diff) |
Merge https://github.com/p-sherratt/oxidized work
* IOS model conditional support for enable password
* rest_client fix
* rescue more errors in ssh
Diffstat (limited to 'lib/oxidized/model/ios.rb')
-rw-r--r-- | lib/oxidized/model/ios.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb index 3fcc7ae..a216126 100644 --- a/lib/oxidized/model/ios.rb +++ b/lib/oxidized/model/ios.rb @@ -23,7 +23,11 @@ class IOS < Oxidized::Model cmd 'show running-config' do |cfg| cfg = cfg.each_line.to_a[3..-1].join + cfg.gsub! /^Current configuration : [^\n]*\n/, '' cfg.sub! /^(ntp clock-period).*/, '! \1' + cfg.gsub! /^\ tunnel\ mpls\ traffic-eng\ bandwidth[^\n]*\n*( + (?:\ [^\n]*\n*)* + tunnel\ mpls\ traffic-eng\ auto-bw)/mx, '\1' cfg end @@ -40,10 +44,12 @@ class IOS < Oxidized::Model post_login 'terminal length 0' post_login 'terminal width 0' # preferred way to handle additional passwords - #post_login do - # send "enable\n" - # send CFG.vars[:enable] + "\n" - #end + if CFG.vars[:enable] and CFG.vars[:enable] != '' + post_login do + send "enable\n" + send CFG.vars[:enable] + "\n" + end + end pre_logout 'exit' end |