summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/ios.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2013-04-19 14:58:58 +0300
committerSaku Ytti <saku@ytti.fi>2013-04-19 14:58:58 +0300
commit5a393d6102655f575549311e6b250534b4dcbb59 (patch)
tree723ed044fd640b8f01615b2eb852f38346443f44 /lib/oxidized/model/ios.rb
parent96668cc2dc0367e3d1a3ec94265ce889b62d8ada (diff)
Add 'cmd :all' convenience, ran after each command
Easier screen-scraping, if each command produces always same set of cruft that needs to be removed
Diffstat (limited to 'lib/oxidized/model/ios.rb')
-rw-r--r--lib/oxidized/model/ios.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb
index a316ccf..c3027e2 100644
--- a/lib/oxidized/model/ios.rb
+++ b/lib/oxidized/model/ios.rb
@@ -2,14 +2,18 @@ class IOS < Oxidized::Model
comment '! '
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-3].join
+ end
+
cmd 'show running-config' do |cfg|
- cfg = cfg.each_line.to_a[3..-2].join
+ cfg = cfg.each_line.to_a[3..-1].join
cfg.sub! /^(ntp clock-period).*/, '! \1'
cfg
end
cmd 'show inventory' do |cfg|
- comment cfg.each_line.to_a[1..-2].join
+ comment cfg
end
cfg :telnet do