MRW Parser changes to add Pre-Req block
A new block for prereq is added to the sensor config
which tells pre-req values for a dbus property
Change-Id: I87e657fefb16f5bc1bfe01f61b25cbdf7af56790
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/gen_ipmi_sensor.pl b/gen_ipmi_sensor.pl
index 766bab1..30fc226 100755
--- a/gen_ipmi_sensor.pl
+++ b/gen_ipmi_sensor.pl
@@ -138,19 +138,12 @@
#will write property named "Property" first then
#other properties.
print $fh " ".$dbusProperty.":\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 ($condition,$offsets) = each %{$dbusPropertyValue}) {
+ print $fh " $condition:\n";
+ while (my ($offset,$values) = each %{$offsets}) {
+ print $fh " $offset:\n";
while (my ($key,$value) = each %{$values}) {
- print $fh " $key: ". $value."\n";
+ print $fh " $key: ". $value."\n";
}
}
}