blob: 9d931c048f20e045a4a9572662f3e877b4dfecbc [file] [log] [blame]
Andrew Geissler65ca8e12022-07-16 11:36:14 -04001#!/usr/bin/perl
Matt Spinlerbbd66d22019-04-09 13:18:29 -05002
3use strict;
4use warnings;
5use mrw::Targets;
6
7my $targetObj;
8my $serverwizFile = $ARGV[0];
9if ((not defined $serverwizFile) || (! -e $serverwizFile)) {
10 die "Usage: $0 [XML filename]\n";
11}
12
13$targetObj = Targets->new;
14$targetObj->loadXML($serverwizFile);
15
16dumpMRW($targetObj);
17
18sub dumpMRW
19{
20 my ($targetObj) = @_;
21
22 for my $target (sort keys %{$targetObj->getAllTargets()}) {
23 print "-----------------------------------------------------------\n";
24 print "Target $target\n";
25 my $thash = $targetObj->getTarget($target);
26
27 for my $attr (keys %{$thash->{ATTRIBUTES}}) {
28 print "\t$attr: ";
29
30 if (ref($thash->{ATTRIBUTES}->{$attr}->{default}) eq "HASH") {
31 print "\n";
32
33 for my $f (sort keys %{$thash->{ATTRIBUTES}->
34 {$attr}->{default}->{field}}) {
35
36 my $val = $thash->{ATTRIBUTES}->
37 {$attr}->{default}->{field}->{$f}->{value};
38 print "\t\t$f: $val\n";
39 }
40 }
41 else {
42 print $thash->{ATTRIBUTES}->{$attr}->{default} . "\n";
43 }
44 }
45 }
46}