summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/xos.rb
diff options
context:
space:
mode:
authorReinier Schoof <reinier@skoef.nl>2015-09-28 09:40:16 +0200
committerReinier Schoof <reinier@skoef.nl>2015-09-28 09:40:16 +0200
commitdbaa0aa77d4420f660262222cbcf99fa3e3cbf4e (patch)
tree8919480bf00a7768966d3bd20e9c9b57dcb8b294 /lib/oxidized/model/xos.rb
parentbf999706f0be794563b78fb90999b5c5fa8e54d5 (diff)
parent073a1bb7e569ed07214249a6b200d310be29709f (diff)
Merge remote-tracking branch 'ytti/master'
Conflicts: lib/oxidized/model/ironware.rb
Diffstat (limited to 'lib/oxidized/model/xos.rb')
-rw-r--r--lib/oxidized/model/xos.rb4
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|