summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2015-09-14 01:31:15 +0300
committerytti <saku@ytti.fi>2015-09-14 01:31:15 +0300
commit3c3aa79d8c7e92f27aa9663d4fa47da1e84592e3 (patch)
treefdbf3d091d150aec355b8176954571a7adbcfe51
parent967fd0ad7aaf2f18b0be28c7e9831a82266a20b4 (diff)
parent3ff08b9ffa39f1f77c50d39549187191bb6f0be7 (diff)
Merge pull request #185 from nickhilliard/bf-utf8-encoding
smooth over ironware broken encoding
-rw-r--r--lib/oxidized/model/ironware.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb
index 709e912..805e07b 100644
--- a/lib/oxidized/model/ironware.rb
+++ b/lib/oxidized/model/ironware.rb
@@ -32,7 +32,7 @@ class IronWare < Oxidized::Model
end
cmd 'show chassis' do |cfg|
- cfg.gsub! /\xFF/n, '' # ugly hack - avoids JSON.dump utf-8 breakage on 1.9..
+ cfg.encode!("UTF-8", :invalid => :replace) #sometimes ironware returns broken encoding
cfg.gsub! /(^((.*)Current temp(.*))$)/, '' #remove unwanted lines current temperature
cfg.gsub! /Speed = [A-Z]{3} \(\d{2}\%\)/, '' #remove unwanted lines Speed Fans
cfg.gsub! /current speed is [A-Z]{3} \(\d{2}\%\)/, ''