grim/convey

Make util package.
cleanup-on-signal
2017-10-13, Eric Fritz
137e9068c5f0
Parents 30663c716c77
Children 4678efc2644b
Make util package.
--- a/cleanup/cleanup.go Fri Oct 13 12:24:56 2017 -0500
+++ b/cleanup/cleanup.go Fri Oct 13 12:27:28 2017 -0500
@@ -24,8 +24,7 @@
"syscall"
"bitbucket.org/rw_grim/convey/logging"
-
- "github.com/satori/go.uuid"
+ "bitbucket.org/rw_grim/convey/util"
)
type (
@@ -71,7 +70,7 @@
c.mutex.Lock()
defer c.mutex.Unlock()
- name := ShortID()
+ name := util.ShortID()
c.funcs[name] = fn
return func() { c.fire(name) }
}
@@ -91,7 +90,3 @@
fn()
}
}
-
-func ShortID() string {
- return uuid.NewV4().String()[0:6]
-}
--- a/docker/run.go Fri Oct 13 12:24:56 2017 -0500
+++ b/docker/run.go Fri Oct 13 12:27:28 2017 -0500
@@ -28,11 +28,11 @@
"github.com/aphistic/gomol"
- "bitbucket.org/rw_grim/convey/cleanup"
"bitbucket.org/rw_grim/convey/environment"
"bitbucket.org/rw_grim/convey/normalize"
"bitbucket.org/rw_grim/convey/state"
"bitbucket.org/rw_grim/convey/tasks"
+ "bitbucket.org/rw_grim/convey/util"
"bitbucket.org/rw_grim/convey/yaml"
)
@@ -227,7 +227,7 @@
return err
}
- runID := cleanup.ShortID()
+ runID := util.ShortID()
logger.Infof("running container with id %s", runID)
// build the dict for the template