Rationalize ipam arguments

- rename -defaultsubnet to -ipsubnet
- default subnet defaults to whole -iprange
- parse and check inside ipam package
- removes some error cases
This commit is contained in:
Bryan Boreham committed 2015-06-10 17:21:16 +01:00
1 parent f956a76455
commit 3a9af4413d
6 files changed
+67 -77

No files matched your search

+2 -4
View File
@@ -134,13 +134,11 @@ func makeAllocator(name string, cidrStr string, quorum uint) *Allocator {
panic(err)
}
_, cidr, err := address.ParseCIDR(cidrStr)
alloc, err := NewAllocator(peername, router.PeerUID(rand.Int63()),
"nick-"+name, cidrStr, quorum)
if err != nil {
panic(err)
}
alloc := NewAllocator(peername, router.PeerUID(rand.Int63()),
"nick-"+name, cidr, quorum)
alloc.defaultSubnet = cidr
return alloc
}