chunk_store: create parent directories

'datastore create storename /path/to/dir/that/may/not/exist' should
work.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
This commit is contained in:
Oguz Bektas 2019-12-17 15:09:42 +01:00 committed by Dietmar Maurer
parent ebfb2df22b
commit 14f1e63067
1 changed files with 2 additions and 2 deletions

View File

@ -93,11 +93,11 @@ impl ChunkStore {
let chunk_dir = Self::chunk_dir(&base);
if let Err(err) = std::fs::create_dir(&base) {
if let Err(err) = std::fs::create_dir_all(&base) {
bail!("unable to create chunk store '{}' at {:?} - {}", name, base, err);
}
if let Err(err) = std::fs::create_dir(&chunk_dir) {
if let Err(err) = std::fs::create_dir_all(&chunk_dir) {
bail!("unable to create chunk store '{}' subdir {:?} - {}", name, chunk_dir, err);
}