From 02b3b8fca75861880f6b1205e7169a368b8cf06e Mon Sep 17 00:00:00 2001 From: Nick Hilliard Date: Sat, 26 Sep 2015 19:10:10 +0100 Subject: fix white space and CR problems on xos model --- lib/oxidized/model/xos.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/xos.rb b/lib/oxidized/model/xos.rb index 309340f..e4a1ed4 100644 --- a/lib/oxidized/model/xos.rb +++ b/lib/oxidized/model/xos.rb @@ -6,7 +6,9 @@ class XOS < Oxidized::Model comment '# ' cmd :all do |cfg| - cfg.each_line.to_a[1..-2].join + # xos inserts leading \r characters and other trailing white space. + # this deletes extraneous \r and trailing white space. + cfg.each_line.to_a[1..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n" end cmd 'show version' do |cfg| -- cgit v1.2.1