From 10ef623e5cf57de70f31063e9efde23e6d00ef75 Mon Sep 17 00:00:00 2001 From: devicenull Date: Tue, 10 Jan 2017 15:58:41 -0500 Subject: Mask out configuration date for fiberdriver Our fiberdriver devices report a timestamp during 'show running-config', which results in a config diff on every run. This patch removes the '+! Configuration saved on 2017/01/10 14:21:20' line from the config, as well as a couple other useless status messages --- lib/oxidized/model/fiberdriver.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/fiberdriver.rb b/lib/oxidized/model/fiberdriver.rb index 8f8eb07..c8a7f6a 100644 --- a/lib/oxidized/model/fiberdriver.rb +++ b/lib/oxidized/model/fiberdriver.rb @@ -11,6 +11,9 @@ class FiberDriver < Oxidized::Model cmd "show running-config" do |cfg| cfg.each_line.to_a[3..-1].join + cfg.gsub! /^Building configuration.*$/, '' + cfg.gsub! /^Current configuration:.*$$/, '' + cfg.gsub! /^! Configuration saved on .*$/, '' end cfg :ssh do -- cgit v1.2.1 From 7f84a8c67438e433e3359de03d7ef82fd025799c Mon Sep 17 00:00:00 2001 From: devicenull Date: Tue, 10 Jan 2017 16:42:28 -0500 Subject: Ensure config gets returned even if no replacements are done --- lib/oxidized/model/fiberdriver.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/fiberdriver.rb b/lib/oxidized/model/fiberdriver.rb index c8a7f6a..abe8f68 100644 --- a/lib/oxidized/model/fiberdriver.rb +++ b/lib/oxidized/model/fiberdriver.rb @@ -14,6 +14,7 @@ class FiberDriver < Oxidized::Model cfg.gsub! /^Building configuration.*$/, '' cfg.gsub! /^Current configuration:.*$$/, '' cfg.gsub! /^! Configuration saved on .*$/, '' + cfg end cfg :ssh do -- cgit v1.2.1