diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-05-03 15:09:34 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-05-03 15:09:34 +0800 |
commit | cf4faa491a699e2a9397ad3809695cc9c0965662 (patch) | |
tree | 62ca961f5f70d8351e10c1e0dd5c6b431b21f373 /cmd/puppeth/wizard.go | |
parent | 59966255add632e3ef09799a8b994ec982bd415a (diff) | |
download | go-tangerine-cf4faa491a699e2a9397ad3809695cc9c0965662.tar go-tangerine-cf4faa491a699e2a9397ad3809695cc9c0965662.tar.gz go-tangerine-cf4faa491a699e2a9397ad3809695cc9c0965662.tar.bz2 go-tangerine-cf4faa491a699e2a9397ad3809695cc9c0965662.tar.lz go-tangerine-cf4faa491a699e2a9397ad3809695cc9c0965662.tar.xz go-tangerine-cf4faa491a699e2a9397ad3809695cc9c0965662.tar.zst go-tangerine-cf4faa491a699e2a9397ad3809695cc9c0965662.zip |
cmd/puppeth, vendor: update ssh, manage server keys (#14398)
Diffstat (limited to 'cmd/puppeth/wizard.go')
-rw-r--r-- | cmd/puppeth/wizard.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index 92d7962a0..9687d5e0d 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -44,14 +44,24 @@ type config struct { bootLight []string // Bootnodes to always connect to by light nodes ethstats string // Ethstats settings to cache for node deploys - Servers []string `json:"servers,omitempty"` + Servers map[string][]byte `json:"servers,omitempty"` +} + +// servers retrieves an alphabetically sorted list of servers. +func (c config) servers() []string { + servers := make([]string, 0, len(c.Servers)) + for server := range c.Servers { + servers = append(servers, server) + } + sort.Strings(servers) + + return servers } // flush dumps the contents of config to disk. func (c config) flush() { os.MkdirAll(filepath.Dir(c.path), 0755) - sort.Strings(c.Servers) out, _ := json.MarshalIndent(c, "", " ") if err := ioutil.WriteFile(c.path, out, 0644); err != nil { log.Warn("Failed to save puppeth configs", "file", c.path, "err", err) |