diff options
author | Nick Hilliard <nick@foobar.org> | 2015-09-26 19:10:10 +0100 |
---|---|---|
committer | Nick Hilliard <nick@foobar.org> | 2015-09-26 19:10:10 +0100 |
commit | 02b3b8fca75861880f6b1205e7169a368b8cf06e (patch) | |
tree | 1cbf5734a629ad21be591bebc4fc6acc37425eca /lib/oxidized/model/xos.rb | |
parent | e70a1a02899cfc80d13dd88b075045cfa40b6f53 (diff) |
fix white space and CR problems on xos model
Diffstat (limited to 'lib/oxidized/model/xos.rb')
-rw-r--r-- | lib/oxidized/model/xos.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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| |