summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-04-09 13:02:12 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-04-09 13:20:32 -0500
commit716262fd664152c088f6330273909b36475767a8 (patch)
treeeeab7d2722523a3cb51fe134426a5cdc0c1dcc3d
parent605b2e9cc42d6f805ce26fe152ed529c040f29d5 (diff)
downloadphosphor-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-xprint_inventory.pl23
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";
+}
OpenPOWER on IntegriCloud