summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-07 08:10:18 -0500
committerJeff Carr <[email protected]>2025-10-07 08:10:18 -0500
commit77d0a62cd49aa8d6ee99cf9db0e7faf71c79d8de (patch)
treee31df8408e39a9bf148cd9faa5b75e859c7cd087
parentb4c737473ed96d42602ec0013dd0e0e84c1536c0 (diff)
-rw-r--r--doGui.go3
-rw-r--r--main.go9
2 files changed, 5 insertions, 7 deletions
diff --git a/doGui.go b/doGui.go
index cf60165..e347bac 100644
--- a/doGui.go
+++ b/doGui.go
@@ -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()
}
diff --git a/main.go b/main.go
index be28e36..5e7b520 100644
--- a/main.go
+++ b/main.go
@@ -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")