summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>2017-09-18 05:50:59 -0500
committerDhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>2017-09-27 00:32:35 -0500
commita93e2097d17e4b8d0eae48c477c12a6f03278e75 (patch)
tree9977ac7afb33349c57807e8e400f81f787dc6f5d
parentfff3da49d28320678a836e1b1d741283a6bc0dd2 (diff)
downloadphosphor-mrw-tools-a93e2097d17e4b8d0eae48c477c12a6f03278e75.tar.gz
phosphor-mrw-tools-a93e2097d17e4b8d0eae48c477c12a6f03278e75.zip
Adding pre-req for IPMI assertions
A pre-req condition can be added for a sensor value, for example presence of a unit should be true for functional to be true. Change-Id: I7b87c7ffa29f06160164aba2b39c743f0f9c733f Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
-rwxr-xr-xgen_ipmi_sensor.pl18
1 files changed, 14 insertions, 4 deletions
diff --git a/gen_ipmi_sensor.pl b/gen_ipmi_sensor.pl
index 053cf33..766bab1 100755
--- a/gen_ipmi_sensor.pl
+++ b/gen_ipmi_sensor.pl
@@ -138,10 +138,20 @@ sub writeToFile
#will write property named "Property" first then
#other properties.
print $fh " ".$dbusProperty.":\n";
- while (my ( $offset,$values) = each %{$dbusPropertyValue}) {
- print $fh " $offset:\n";
- while (my ( $key,$value) = each %{$values}) {
- print $fh " $key: ". $value."\n";
+ while (my ($offset,$values) = each %{$dbusPropertyValue}) {
+ if ($offset eq "prereq") {
+ print $fh " $offset:\n";
+ while (my ($preOffset,$preValues) = each %{$values}) {
+ print $fh " $preOffset:\n";
+ while (my ($key,$value) = each %{$preValues}) {
+ print $fh " $key: ". $value."\n";
+ }
+ }
+ } else {
+ print $fh " $offset:\n";
+ while (my ($key,$value) = each %{$values}) {
+ print $fh " $key: ". $value."\n";
+ }
}
}
}
OpenPOWER on IntegriCloud