From b0a21076e91dfe0a1de2412746b1283930a43db5 Mon Sep 17 00:00:00 2001 From: phamt Date: Mon, 26 Nov 2012 16:41:31 +0000 Subject: [PATCH] Fixed webportal bug where dasd list entry only contains 1 device. Renamed chhypervisor --smapi to --smcli. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14428 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/xcat/plugins/webportal.pm | 15 ++++++++++++--- xCAT-server/lib/xcat/plugins/zvm.pm | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/xCAT-UI/xcat/plugins/webportal.pm b/xCAT-UI/xcat/plugins/webportal.pm index 873992f19..f0ce30078 100644 --- a/xCAT-UI/xcat/plugins/webportal.pm +++ b/xCAT-UI/xcat/plugins/webportal.pm @@ -261,9 +261,18 @@ sub provzlinux { # Read XML file my $data = $xml->XMLin($tmpl); - my $devices = $data->{'dasd'}->{'devices'}->{'listentry'}; - foreach (@$devices) { - + my $devices_ref = $data->{'dasd'}->{'devices'}->{'listentry'}; + my @devices; + + if (ref($devices_ref) eq 'HASH') { + # In the case of 1 device in the listentry, push hash into array + push(@devices, $devices_ref); + } else { + # Listentry is an array reference + @devices = @$devices_ref; + } + + foreach (@devices) { # Get disk virtual address and disk type $type = $_->{'drivers'}->{'listentry'}->{'modules'}->{'module_entry'}->{'listentry'}; $virt_addr = $_->{'sysfs_bus_id'}; diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 886b94702..04bb35a23 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -5527,8 +5527,8 @@ sub changeHypervisor { $out = xCAT::zvmCPUtils->getNetwork( $hcp, $netName ); } - # smapi [api] [args] - elsif ( $args->[0] eq "--smapi" ) { + # smcli [api] [args] + elsif ( $args->[0] eq "--smcli" ) { # Invoke SMAPI API directly through zHCP smcli my $str = "@{$args}"; $str =~ s/$args->[0]//g;