From 3ff08b9ffa39f1f77c50d39549187191bb6f0be7 Mon Sep 17 00:00:00 2001 From: Nick Hilliard Date: Sun, 13 Sep 2015 23:27:21 +0100 Subject: smooth over ironware broken encoding --- lib/oxidized/model/ironware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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}\%\)/, '' -- cgit v1.2.1