From d2c2c2c1162498e6f7c2b9298795e3ef77b6523b Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Fri, 1 Nov 2013 19:30:30 +0000 Subject: [PATCH] devmapper: rename Create() to OnCreate(), cleanup tests --- devmapper/plugin.go | 2 +- devmapper/plugin_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/devmapper/plugin.go b/devmapper/plugin.go index 5013f1a47e..67252eda38 100644 --- a/devmapper/plugin.go +++ b/devmapper/plugin.go @@ -44,7 +44,7 @@ func (b *DMBackend) Cleanup() error { return b.DeviceSet.Shutdown() } -func (b *DMBackend) Create(img Image, layer archive.Archive) error { +func (b *DMBackend) OnCreate(img Image, layer archive.Archive) error { // Determine the source of the snapshot (parent id or init device) var parentID string if parent, err := img.Parent(); err != nil { diff --git a/devmapper/plugin_test.go b/devmapper/plugin_test.go index 08df3c3171..5f80c1dab2 100644 --- a/devmapper/plugin_test.go +++ b/devmapper/plugin_test.go @@ -2,7 +2,7 @@ package devmapper import ( "io/ioutil" - _ "os" + "os" "testing" ) @@ -42,7 +42,7 @@ func mkTestDirectory(t *testing.T) string { func TestInit(t *testing.T) { home := mkTestDirectory(t) - // defer os.RemoveAll(home) + defer os.RemoveAll(home) plugin, err := Init(home) if err != nil { t.Fatal(err) @@ -54,8 +54,8 @@ func TestInit(t *testing.T) { } }() img := mkTestImage(t) - // defer os.RemoveAll(img.(*TestImage).path) - if err := plugin.Create(img, nil); err != nil { + defer os.RemoveAll(img.(*TestImage).path) + if err := plugin.OnCreate(img, nil); err != nil { t.Fatal(err) } }