consul: Sort datacenter list. Fixes #198
This commit is contained in:
parent
a47db238bb
commit
d0d85b461c
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"github.com/armon/go-metrics"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -84,6 +85,9 @@ func (c *Catalog) ListDatacenters(args *struct{}, reply *[]string) error {
|
|||
dcs = append(dcs, dc)
|
||||
}
|
||||
|
||||
// Sort the DCs
|
||||
sort.Strings(dcs)
|
||||
|
||||
// Return
|
||||
*reply = dcs
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue