-Fix empty disc creation when nfs:// syntax is used

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4696 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-11-30 19:51:33 +00:00
parent 171282e820
commit 93474b3a30

View File

@ -631,21 +631,24 @@ sub createstorage {
}
}
my $mountpath;
my $pathappend;
my $storageserver;
#for nfs paths and qemu-img, we do the magic locally only for now
my $basename;
my $dirname;
if ($filename =~ /^nfs:/) {
$filename = get_path_for_nfsuri($filename);
if (ref $filename) { #if we got a reference back instead of a string, it is a remote location
$storageserver = $filename->[0];
$filename = $filename->[1];
}
$filename =~ s/\/$//;
$mountpath = $filename;
$filename .= "/$node/".fileparse($diskstruct->[0]->{source}->{file});
$pathappend = "/$node/";
}
my $basename;
my $dirname;
($basename,$dirname) = fileparse($filename);
unless ($storageserver) {
if (-f $filename) {
@ -665,9 +668,10 @@ sub createstorage {
my $foundmount;
foreach (@mounts) {
if (/^$storageserver:$mountpath/) {
s/ on (\S*) type nfs/$1/;
chomp;
s/^.* on (\S*) type nfs.*$/$1/;
$dirname = $_;
mkpath($dirname);
mkpath($dirname.$pathappend);
$foundmount=1;
last;
}