diff options
| -rw-r--r-- | doGui.go | 3 | ||||
| -rw-r--r-- | main.go | 9 |
2 files changed, 5 insertions, 7 deletions
@@ -77,5 +77,6 @@ func saveMachineState() { log.Info("have machine:", m.Hostname) cur.Append(m) } - cur.ConfigSave(me.machinesfile) + cur.Filename = me.machines.Filename + cur.Save() } @@ -7,6 +7,7 @@ import ( "os" "time" + "go.wit.com/lib/config" "go.wit.com/lib/gui/prep" "go.wit.com/lib/protobuf/httppb" "go.wit.com/lib/protobuf/zoopb" @@ -31,12 +32,8 @@ func main() { me.hostname, _ = os.Hostname() me.pollDelay = time.Hour me.machines = zoopb.NewMachines() - if fpath, err := me.machines.ConfigLoad(); err != nil { - log.Warn("load config failed", err) - me.machinesfile = fpath - // os.Exit(-1) - } else { - me.machinesfile = fpath + if err := config.ConfigLoad(me.machines, "zookeeper", "machine"); err != nil { + badExit(err) } if argv.List != nil { log.Info("do list here") |
