diff options
author | Matt Spinler <spinler@us.ibm.com> | 2019-04-09 13:02:12 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2019-04-09 13:20:32 -0500 |
commit | 716262fd664152c088f6330273909b36475767a8 (patch) | |
tree | eeab7d2722523a3cb51fe134426a5cdc0c1dcc3d | |
parent | 605b2e9cc42d6f805ce26fe152ed529c040f29d5 (diff) | |
download | phosphor-mrw-tools-716262fd664152c088f6330273909b36475767a8.tar.gz phosphor-mrw-tools-716262fd664152c088f6330273909b36475767a8.zip |
Add tool to print out the inventory
The Inventory.pm module queries the MRW to find the system inventory,
and this is a simple wrapper script to print out that inventory for
debug.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I2cd56f954a856077b252c7cede07bccaad440e42
-rwxr-xr-x | print_inventory.pl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/print_inventory.pl b/print_inventory.pl new file mode 100755 index 0000000..4bcb180 --- /dev/null +++ b/print_inventory.pl @@ -0,0 +1,23 @@ +#! /usr/bin/perl + +use strict; +use warnings; +use mrw::Targets; +use mrw::Inventory; + +my $targetObj; +my $serverwizFile = $ARGV[0]; +if ((not defined $serverwizFile) || (! -e $serverwizFile)) { + die "Usage: $0 [XML filename]\n"; +} + +$targetObj = Targets->new; +$targetObj->loadXML($serverwizFile); + +my @inventory = Inventory::getInventory($targetObj); + +for my $item (@inventory) { + print "---------------------------------------------------------------\n"; + print "Target: $item->{TARGET}\n"; + print "Name: $item->{OBMC_NAME}\n"; +} |