|
@@ -3,13 +3,13 @@ package api
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
"mime"
|
|
"mime"
|
|
- "os"
|
|
|
|
"path/filepath"
|
|
"path/filepath"
|
|
"sort"
|
|
"sort"
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types"
|
|
|
|
+ "github.com/docker/docker/pkg/system"
|
|
"github.com/docker/docker/pkg/version"
|
|
"github.com/docker/docker/pkg/version"
|
|
"github.com/docker/libtrust"
|
|
"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,
|
|
// LoadOrCreateTrustKey attempts to load the libtrust key at the given path,
|
|
// otherwise generates a new one
|
|
// otherwise generates a new one
|
|
func LoadOrCreateTrustKey(trustKeyPath string) (libtrust.PrivateKey, error) {
|
|
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
|
|
return nil, err
|
|
}
|
|
}
|
|
trustKey, err := libtrust.LoadKeyFile(trustKeyPath)
|
|
trustKey, err := libtrust.LoadKeyFile(trustKeyPath)
|