From 5a393d6102655f575549311e6b250534b4dcbb59 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Fri, 19 Apr 2013 14:58:58 +0300 Subject: 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 --- lib/oxidized/model/ios.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/oxidized/model/ios.rb') 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 -- cgit v1.2.1