From 716262fd664152c088f6330273909b36475767a8 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Tue, 9 Apr 2019 13:02:12 -0500 Subject: 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 Change-Id: I2cd56f954a856077b252c7cede07bccaad440e42 --- print_inventory.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 print_inventory.pl 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"; +} -- cgit v1.2.1