Tidy up IPAM parts of 'weave status'

- removed detailed "free" and "owned" printout of 'space'
 - removed "free" counts from ring lines - limited usefulness and often out of date.
 - removed trailing newline
 - changed "Ring" to "Owned Ranges"
 - print subnet in CIDR format
This commit is contained in:
Bryan Boreham committed 2015-05-19 10:38:26 +01:00
1 parent e9963945d6
commit b6a8c48097
2 files changed
+11 -11

No files matched your search

+8 -8
View File
@@ -456,7 +456,7 @@ func (alloc *Allocator) actorLoop(actionChan <-chan func()) {
func (alloc *Allocator) string() string {
var buf bytes.Buffer
fmt.Fprintf(&buf, "Allocator subnet %s+%d\n", alloc.subnetStart.String(), alloc.subnetSize)
fmt.Fprintf(&buf, "Allocator subnet %s/%d\n", alloc.subnetStart.String(), alloc.prefixLen)
if alloc.ring.Empty() {
fmt.Fprintf(&buf, "Paxos: %s", alloc.paxos.String())
@@ -467,16 +467,16 @@ func (alloc *Allocator) string() string {
fmt.Fprintf(&buf, " Free IPs: ~%.1f%%, %d local, ~%d remote\n",
percentFree, localFreeSpace, remoteFreeSpace)
fmt.Fprint(&buf, "Owned Ranges:")
alloc.ring.FprintWithNicknames(&buf, alloc.nicknames)
fmt.Fprintf(&buf, alloc.space.String())
if len(alloc.pendingAllocates)+len(alloc.pendingClaims) > 0 {
fmt.Fprintf(&buf, "\nPending requests for ")
}
for _, op := range alloc.pendingAllocates {
fmt.Fprintf(&buf, "%s, ", op.String())
}
for _, op := range alloc.pendingClaims {
fmt.Fprintf(&buf, "%s, ", op.String())
for _, op := range alloc.pendingAllocates {
fmt.Fprintf(&buf, "%s, ", op.String())
}
for _, op := range alloc.pendingClaims {
fmt.Fprintf(&buf, "%s, ", op.String())
}
}
}
return buf.String()