use -e to test if volume exists

Because rootdir is a directory, not a file
This commit is contained in:
Dietmar Maurer
2011-12-01 08:41:33 +01:00
parent 4eab0788e3
commit db2ec87f83
3 changed files with 9 additions and 3 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=libpve-storage-perl
PKGREL=8
PKGREL=9
DESTDIR=
PREFIX=/usr

View File

@ -1271,7 +1271,7 @@ sub vdisk_alloc {
my $path = "$imagedir/$name";
die "disk image '$path' already exists\n" if -f $path;
die "disk image '$path' already exists\n" if -e $path;
run_command("/usr/bin/qemu-img create -f $fmt '$path' ${size}K",
errmsg => "unable to create image");
@ -1966,7 +1966,7 @@ sub activate_volumes {
# check is volume exists
if ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs') {
die "volume '$volid' does not exist\n" if ! -f $path;
die "volume '$volid' does not exist\n" if ! -e $path;
} else {
die "volume '$volid' does not exist\n" if ! -b $path;
}

View File

@ -1,3 +1,9 @@
libpve-storage-perl (2.0-9) unstable; urgency=low
* use -e (instead of -f) to test if volume exists
-- Proxmox Support Team <support@proxmox.com> Fri, 02 Dec 2011 10:31:01 +0100
libpve-storage-perl (2.0-8) unstable; urgency=low
* fix iscsi size bug