Windows: mkdirall volume path aware

Signed-off-by: jhowardmsft <jhoward@microsoft.com>
Upstream-commit: 86d1223a29907ffc6afba557b5138cfad7816bb4
Component: engine
This commit is contained in:
jhowardmsft
2015-04-23 15:55:36 -07:00
committed by John Howard
parent 585f4aedc7
commit 8259fbca23
3 changed files with 78 additions and 2 deletions

View File

@ -3,13 +3,13 @@ package api
import (
"fmt"
"mime"
"os"
"path/filepath"
"sort"
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/pkg/version"
"github.com/docker/libtrust"
)
@ -107,7 +107,8 @@ func MatchesContentType(contentType, expectedType string) bool {
// LoadOrCreateTrustKey attempts to load the libtrust key at the given path,
// otherwise generates a new one
func LoadOrCreateTrustKey(trustKeyPath string) (libtrust.PrivateKey, error) {
if err := os.MkdirAll(filepath.Dir(trustKeyPath), 0700); err != nil {
err := system.MkdirAll(filepath.Dir(trustKeyPath), 0700)
if err != nil {
return nil, err
}
trustKey, err := libtrust.LoadKeyFile(trustKeyPath)