diff options
author | Samer Abdel-Hafez <sam@arahant.net> | 2013-10-25 15:00:13 -0700 |
---|---|---|
committer | Samer Abdel-Hafez <sam@arahant.net> | 2013-10-25 15:00:13 -0700 |
commit | 056ecb1a94d24085497d1baa304645390052e50b (patch) | |
tree | 96764af0bcc7980c66779f7ef42e832df88982d5 /lib/oxidized/model/ios.rb | |
parent | feba4c2b9e0faeb40cad32f16d7b024a2d4327ae (diff) | |
parent | 4455a5b91accda5da7c1b8128cb045c7eb7bb5da (diff) |
Merge pull request #1 from ytti/master
update local branch
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 |