From 2a998b99d93486f381c9af2160736fc1724aa4c9 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 26 Jun 2013 14:33:52 +0000 Subject: [PATCH] Have rvitals avoid requesting the same sensor multiple times git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16770 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ipmi.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 2d8e03427..df56d80dd 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -4789,15 +4789,18 @@ sub vitals { } $sessdata->{sensorstoread} = []; + my %usedkeys; foreach(keys %sensor_filters) { my $filter = $_; if ($filter eq "energy" or $filter eq "leds") { next; } foreach $key (sort {$sdr_hash{$a}->id_string cmp $sdr_hash{$b}->id_string} keys %sdr_hash) { + if ($usedkeys{$key}) { next; } #avoid duplicate requests for sensor data my $sdr = $sdr_hash{$key}; if(($doall and not $sdr->rec_type == 0x11 and not $sdr->sensor_type==0xed) or ($sdr->rec_type == 0x01 and $sdr->sensor_type == $filter)) { my $lformat = $format; push @{$sessdata->{sensorstoread}},$sdr; + $usedkeys{$key}=1; } } }