Skip to content

Commit

Permalink
Merge pull request #381 from oracle/issue-379
Browse files Browse the repository at this point in the history
Utils initialisation should create persistence sub-directories only if parent directory exists
  • Loading branch information
thegridman authored Dec 19, 2019
2 parents eba9fcd + 930d02a commit 9b2727b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/utilsinit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ func main() {
}
}

dirNames := []string{persistenceActiveDir, persistenceTrashDir, persistenceSnapshotsDir}
var dirNames []string

_, err = os.Stat(persistenceDir)
if err == nil {
// if "/persistence" exists then we'll create the sub-directories
dirNames = append(dirNames, persistenceActiveDir, persistenceTrashDir, persistenceSnapshotsDir)
}

_, err = os.Stat(snapshotDir)
if err == nil {
Expand Down

0 comments on commit 9b2727b

Please sign in to comment.