diff options
author | ytti <saku@ytti.fi> | 2015-09-26 13:46:55 -0500 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2015-09-26 13:46:55 -0500 |
commit | 576a0b1df455d14f4bde0d21c63a1a498248e485 (patch) | |
tree | 1cbf5734a629ad21be591bebc4fc6acc37425eca /lib/oxidized | |
parent | e70a1a02899cfc80d13dd88b075045cfa40b6f53 (diff) | |
parent | 02b3b8fca75861880f6b1205e7169a368b8cf06e (diff) |
Merge pull request #197 from nickhilliard/master
fix white space and CR problems on xos model
Diffstat (limited to 'lib/oxidized')
-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| |