Skip to content

Commit

Permalink
Merge pull request #9 from crosbymichael/fix-aufs-tests
Browse files Browse the repository at this point in the history
Fix aufs error at startup
  • Loading branch information
crosbymichael committed Nov 8, 2013
2 parents 8c21d2a + 51c93c0 commit 6d0b3f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aufs/aufs.go
Expand Up @@ -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
}
Expand Down
4 changes: 4 additions & 0 deletions devmapper/driver.go
Expand Up @@ -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()
}
Expand Down
3 changes: 2 additions & 1 deletion graphdriver/driver.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions graphdriver/dummy/driver.go
@@ -1,11 +1,11 @@
package dummy

import (
"fmt"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/graphdriver"
"os"
"path"
"fmt"
)

func init() {
Expand All @@ -14,7 +14,7 @@ func init() {

func Init(home string) (graphdriver.Driver, error) {
d := &Driver{
home: home,
home: home,
}
return d, nil
}
Expand All @@ -23,6 +23,10 @@ type Driver struct {
home string
}

func (d *Driver) String() string {
return "dummy"
}

func (d *Driver) Cleanup() error {
return nil
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
}

0 comments on commit 6d0b3f3

Please sign in to comment.