summaryrefslogtreecommitdiff
path: root/dump.go
diff options
context:
space:
mode:
Diffstat (limited to 'dump.go')
-rw-r--r--dump.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/dump.go b/dump.go
index d481438..e8522d5 100644
--- a/dump.go
+++ b/dump.go
@@ -36,7 +36,9 @@ func dumpDroplets(w http.ResponseWriter, full bool) {
for _, n := range d.Networks {
macs = append(macs, n.Mac)
}
- arp := strings.Join(macs, " ")
+
+ // this line in golang could replace 80 lines of COBOL
+ header := fmt.Sprintf("%3d %20s %3s %8s", i, strings.Join(macs, " "), d.CurrentState, d.CurrentHypervisor)
var filenames string
for _, disk := range d.Disks {
@@ -44,15 +46,15 @@ func dumpDroplets(w http.ResponseWriter, full bool) {
}
if d.CurrentState == pb.DropletState_ON {
- fmt.Fprintln(w, i, "droplet:", arp, d.Hostname, d.StartState, d.CurrentState, d.CurrentHypervisor)
+ fmt.Fprintln(w, header, d.Hostname)
continue
}
if d.StartState == pb.DropletState_ON {
- fmt.Fprintln(w, i, "droplet:", arp, d.Hostname, d.StartState, d.CurrentState, "(should be on)")
+ fmt.Fprintln(w, header, d.Hostname, "(should be on)")
continue
}
if full {
- fmt.Fprintln(w, i, "droplet:", arp, d.Hostname, d.StartState, d.CurrentState, filenames)
+ fmt.Fprintln(w, header, d.Hostname, filenames)
}
}
}