diff --git a/PVE/Storage/DirPlugin.pm b/PVE/Storage/DirPlugin.pm index bc3c61f..23cb6bb 100644 --- a/PVE/Storage/DirPlugin.pm +++ b/PVE/Storage/DirPlugin.pm @@ -28,6 +28,11 @@ sub properties { description => "File system path.", type => 'string', format => 'pve-storage-path', }, + mkdir => { + description => "Create the directory if it doesn't exist.", + type => 'boolean', + default => 'yes', + }, }; } @@ -40,6 +45,7 @@ sub options { maxfiles => { optional => 1 }, content => { optional => 1 }, format => { optional => 1 }, + mkdir => { optional => 1 }, }; } @@ -48,8 +54,10 @@ sub options { sub activate_storage { my ($class, $storeid, $scfg, $cache) = @_; - my $path = $scfg->{path}; - mkpath $path; + if (!defined($scfg->{mkdir}) || $scfg->{mkdir}) { + my $path = $scfg->{path}; + mkpath $path; + } $class->SUPER::activate_storage($storeid, $scfg, $cache); } diff --git a/changelog.Debian b/changelog.Debian index 624f984..ecbd11b 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -4,6 +4,8 @@ libpve-storage-perl (4.0-52) unstable; urgency=medium * add ceph version helpers + * fix 1012: dir: add mkdir option + -- Proxmox Support Team Tue, 07 Jun 2016 10:30:02 +0200 libpve-storage-perl (4.0-51) unstable; urgency=medium