IPMI Parser Script Updates
This commit adds a new option to the IPMI MRW
parsing scripts (--skip-broken-mrw).
When specified, the option will cause the scripts
to ignore broken MRW targets such as IPMI sensor
targets without a valid SENSOR_ID attribute
or a FRU without a valid FRU_ID.
This allows us to pull in an in-progress MRW without
it breaking our builds.
Tested:
I tested the scripts against an incomplete MRW and made
sure that the scripts ignored broken targets and generated
output config files for whatever targets were valid.
Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: Ibf2ca3769e6030d62e73fb362d73a775433273bc
diff --git a/gen_fru_properties.pl b/gen_fru_properties.pl
index 43cc753..c371658 100755
--- a/gen_fru_properties.pl
+++ b/gen_fru_properties.pl
@@ -13,12 +13,14 @@
my $mrwFile = "";
my $outFile = "";
my $configFile = "";
+my $skipBrokenMrw = 0;
GetOptions(
"m=s" => \$mrwFile,
"c=s" => \$configFile,
"o=s" => \$outFile,
+"skip-broken-mrw" => \$skipBrokenMrw
)
or printUsage();
@@ -79,6 +81,10 @@
my ($yamlDict) = @_;
for my $type (keys %targetHash)
{
+ if($skipBrokenMrw and !exists $defaultPaths{$type})
+ {
+ next;
+ }
print $fh $defaultPaths{$type}.":";
print $fh "\n";
while (my ($interface,$propertyMap) = each %{$yamlDict->{$type}})
@@ -140,6 +146,9 @@
sub printUsage
{
print "
- $0 -m [MRW file] -c [Config yaml] -o [Output filename]\n";
+ $0 -m [MRW file] -c [Config yaml] -o [Output filename] [OPTIONS]
+Options:
+ --skip-broken-mrw = Skip broken MRW targets
+ \n";
exit(1);
}