From e82d2d1f660d15f190246c53ee8f9344b83d3593 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 2 Jul 2010 19:09:49 +0000 Subject: [PATCH] -Put in some early bailout on detectable missing storage devices git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6638 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index a48ab1197..9fa6b9441 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -153,6 +153,7 @@ sub get_filepath_by_url { #sadly, libvirt has opted for the 'enterprisey' way li return $_->get_path(); } } + return undef; } sub get_path_for_nfsuri { my $diskname = shift; @@ -254,6 +255,9 @@ sub build_diskstruct { $diskhash->{source}->{dev} = substr($disk_parts[0], 4); } elsif ($disk_parts[0] =~ m/^nfs:\/\/(.*)$/) { $diskhash->{source}->{file} = get_filepath_by_url($disk_parts[0],$diskhash->{target}->{dev}); #"/var/lib/xcat/vmnt/nfs_".$1."/$node/".$diskhash->{target}->{dev}; + unless ($diskhash->{source}->{file}) { + die "Unable to find ".$diskhash->{target}->{dev}." at ".$disk_parts[0]; + } } else { $diskhash->{source}->{file} = $disk_parts[0]; }