From 2cad6a42d2c9a218c374225b3c43c7a92803d1a4 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 8 Jun 2010 18:19:48 +0000 Subject: [PATCH] -Fix lsvm on an empty hypervisor git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6394 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 9dc6cfb02..b295eba53 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -1426,8 +1426,12 @@ sub lsvm { my $hyp = $args{hyp}; $hyphash{$hyp}->{hostview} = get_hostview(hypname=>$hyp,conn=>$hyphash{$hyp}->{conn}); #,properties=>['config','configManager']); use Data::Dumper; - my @vms = @{$hyphash{$hyp}->{hostview}->vm}; - foreach (@vms) { + if ($hyphash{$hyp}->{hostview}->vm) { + my $vms = $hyphash{$hyp}->{hostview}->vm; + unless ($vms) { + return; + } + foreach (@$vms) { my $vmv = $hyphash{$hyp}->{conn}->get_view(mo_ref=>$_); sendmsg($vmv->name,$hyp); }