Skip to content

Commit

Permalink
Support both versions of APSS attributes
Browse files Browse the repository at this point in the history
Adding code to support both contested versions of the APSS
attributes from the MRW.  This allows us to work with all current
MRW xmls while they transition to a common scheme.

Change-Id: I83419ea00c8f45ae11b88f4aaaaa72188c093ce4
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41425
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
  • Loading branch information
dcrowell77 authored and ploetzma committed Jun 15, 2017
1 parent 6a85bab commit ce6a132
Showing 1 changed file with 44 additions and 14 deletions.
58 changes: 44 additions & 14 deletions src/usr/targeting/common/processMrw.pl
Original file line number Diff line number Diff line change
Expand Up @@ -290,24 +290,54 @@ sub processApss {
{
my $entity_id=$targetObj->
getAttribute($child,"IPMI_ENTITY_ID");
my $sensor_type=$targetObj->
getAttribute($child,"IPMI_SENSOR_TYPE");
my $name=$targetObj->
getAttribute($child,"IPMI_SENSOR_NAME_SUFFIX");
my $sensor_id=$targetObj->
getAttribute($child,"IPMI_SENSOR_ID");
my $sensor_type=$targetObj->
getAttribute($child,"IPMI_SENSOR_TYPE");
my $sensor_evt=$targetObj->
getAttribute($child,"IPMI_SENSOR_READING_TYPE");
my $channel = $targetObj->
getAttribute($child,"ADC_CHANNEL_ASSIGNMENT");
my $channel_id = $targetObj->
getAttribute($child,"ADC_CHANNEL_ID");
my $channel_gain = $targetObj->
getAttribute($child,"ADC_CHANNEL_GAIN");
my $channel_offset = $targetObj->
getAttribute($child,"ADC_CHANNEL_OFFSET");
my $channel_ground = $targetObj->
getAttribute($child,"ADC_CHANNEL_GROUND");

#@fixme-RTC:175309-Remove deprecated support
my $name;
my $channel;
my $channel_id;
my $channel_gain;
my $channel_offset;
my $channel_ground;
# Temporarily allow both old and new attribute names until
# all of the SW2 xmls get in sync
if (!$targetObj->isBadAttribute($child,"IPMI_SENSOR_NAME_SUFFIX") )
{
# Using deprecated names
$name = $targetObj->
getAttribute($child,"IPMI_SENSOR_NAME_SUFFIX");
$channel = $targetObj->
getAttribute($child,"ADC_CHANNEL_ASSIGNMENT");
$channel_id = $targetObj->
getAttribute($child,"ADC_CHANNEL_ID");
$channel_gain = $targetObj->
getAttribute($child,"ADC_CHANNEL_GAIN");
$channel_offset = $targetObj->
getAttribute($child,"ADC_CHANNEL_OFFSET");
$channel_ground = $targetObj->
getAttribute($child,"ADC_CHANNEL_GROUND");
}
else
{
# Using correct/new names
$name = $targetObj->
getAttribute($child,"FUNCTION_NAME");
$channel = $targetObj->
getAttribute($child,"CHANNEL");
$channel_id = $targetObj->
getAttribute($child,"FUNCTION_ID");
$channel_gain = $targetObj->
getAttribute($child,"GAIN");
$channel_offset = $targetObj->
getAttribute($child,"OFFSET");
$channel_ground = $targetObj->
getAttribute($child,"GND");
}

$name=~s/\n//g;
$name=~s/\s+//g;
Expand Down

0 comments on commit ce6a132

Please sign in to comment.