Merge pull request #1122 from mrjana/store

Need boltdb Register only in tests
This commit is contained in:
Alessandro Boch 2016-04-15 16:55:12 -07:00
commit 6909b08a1d
2 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,6 @@ import (
"sync"
log "github.com/Sirupsen/logrus"
"github.com/docker/libkv/store/boltdb"
"github.com/docker/libnetwork/bitseq"
"github.com/docker/libnetwork/datastore"
"github.com/docker/libnetwork/discoverapi"
@ -26,10 +25,6 @@ const (
dsDataKey = "ipam/" + ipamapi.DefaultIPAM + "/data"
)
func init() {
boltdb.Register()
}
// Allocator provides per address space ipv4/ipv6 book keeping
type Allocator struct {
// Predefined pools for default address spaces

View File

@ -12,6 +12,7 @@ import (
"time"
"github.com/docker/libkv/store"
"github.com/docker/libkv/store/boltdb"
"github.com/docker/libnetwork/bitseq"
"github.com/docker/libnetwork/datastore"
"github.com/docker/libnetwork/ipamapi"
@ -24,6 +25,10 @@ const (
defaultPrefix = "/tmp/libnetwork/test/ipam"
)
func init() {
boltdb.Register()
}
// OptionBoltdbWithRandomDBFile function returns a random dir for local store backend
func randomLocalStore() (datastore.DataStore, error) {
tmp, err := ioutil.TempFile("", "libnetwork-")