1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #9 from crosbymichael/fix-aufs-tests

Fix aufs error at startup
This commit is contained in:
Michael Crosby 2013-11-08 09:55:24 -08:00
commit 6d0b3f350e
4 changed files with 13 additions and 6 deletions

View file

@ -58,7 +58,7 @@ func Init(root string) (graphdriver.Driver, error) {
// if it already exists
// If not populate the dir structure
aufsPath := path.Join(root, "aufs")
if err := os.Mkdir(aufsPath, 0755); err != nil {
if err := os.MkdirAll(aufsPath, 0755); err != nil {
if os.IsExist(err) {
return &AufsDriver{root}, nil
}

View file

@ -33,6 +33,10 @@ func Init(home string) (graphdriver.Driver, error) {
return d, nil
}
func (d *Driver) String() string {
return "devicemapper"
}
func (d *Driver) Cleanup() error {
return d.DeviceSet.Shutdown()
}

View file

@ -3,10 +3,10 @@ package graphdriver
import (
"fmt"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/utils"
"os"
)
type InitFunc func(root string) (Driver, error)
type Driver interface {
@ -64,6 +64,7 @@ func New(root string) (Driver, error) {
for _, name := range priority {
driver, lastError = getDriver(name, root)
if lastError != nil {
utils.Debugf("Error loading driver %s: %s", name, lastError)
continue
}
return driver, nil

View file

@ -1,11 +1,11 @@
package dummy
import (
"fmt"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/graphdriver"
"os"
"path"
"fmt"
)
func init() {
@ -14,7 +14,7 @@ func init() {
func Init(home string) (graphdriver.Driver, error) {
d := &Driver{
home: home,
home: home,
}
return d, nil
}
@ -23,6 +23,10 @@ type Driver struct {
home string
}
func (d *Driver) String() string {
return "dummy"
}
func (d *Driver) Cleanup() error {
return nil
}
@ -52,7 +56,6 @@ func (d *Driver) dir(id string) string {
return path.Join(d.home, "dir", path.Base(id))
}
func (d *Driver) Remove(id string) error {
if _, err := os.Stat(d.dir(id)); err != nil {
return err
@ -81,4 +84,3 @@ func (d *Driver) DiffSize(id string) (int64, error) {
func (d *Driver) Changes(id string) ([]archive.Change, error) {
return nil, fmt.Errorf("Not implemented")
}