From 41700ddcb0ba9d220a7bca4810fca4b859650665 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 18 Sep 2008 18:31:01 +0000 Subject: [PATCH] -Further fix formula manipulation flaw for non-type-1 sensors git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2194 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ipmi.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index a381792f7..ca530544f 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -332,8 +332,12 @@ sub translate_sensor { my $lformat; my $per; $unitdesc = $units{$sdr->sensor_units_2}; - $value = (($sdr->M * $reading) + ($sdr->B * (10**$sdr->B_exp))) * (10**$sdr->R_exp); - if($sdr->linearization == 0) { + if ($sdr->rec_type == 1) { + $value = (($sdr->M * $reading) + ($sdr->B * (10**$sdr->B_exp))) * (10**$sdr->R_exp); + } else { + $value = $reading; + } + if($sdr->rec_type !=1 or $sdr->linearization == 0) { $reading = $value; if($value == int($value)) { $lformat = "%-30s%8d%-20s";