From 254e496abfe30d275a5caa4925e2359dea427f93 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 22 Sep 2025 16:34:30 -0500 Subject: [PATCH] fix build --- doGui.go | 2 +- main.go | 7 +++++-- structs.go | 31 ++++++++++++++++--------------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/doGui.go b/doGui.go index 8945721..cf60165 100644 --- a/doGui.go +++ b/doGui.go @@ -77,5 +77,5 @@ func saveMachineState() { log.Info("have machine:", m.Hostname) cur.Append(m) } - cur.ConfigSave() + cur.ConfigSave(me.machinesfile) } diff --git a/main.go b/main.go index 8362933..a8a612d 100644 --- a/main.go +++ b/main.go @@ -33,9 +33,12 @@ func main() { me.hostname, _ = os.Hostname() me.pollDelay = time.Hour me.machines = zoopb.NewMachines() - if err := me.machines.ConfigLoad(); err != nil { + if fpath, err := me.machines.ConfigLoad(); err != nil { log.Warn("load config failed", err) - os.Exit(-1) + me.machinesfile = fpath + // os.Exit(-1) + } else { + me.machinesfile = fpath } if argv.List != nil { log.Info("do list here") diff --git a/structs.go b/structs.go index fa740e5..136de37 100644 --- a/structs.go +++ b/structs.go @@ -17,19 +17,20 @@ var me *mainType // this app's variables type mainType struct { - pp *arg.Parser // for parsing the command line args. Yay to alexf lint! - hostname string // my fqdn dns zookeeper hostname - pollDelay time.Duration // how often to report our status - dog *time.Ticker // the watchdog timer - dogchan chan bool // can kill the watchdog - distro string // debian,redhat,gentoo,macos,wincrap - packages *zoopb.Packages // installed packages and versions - machines *zoopb.Machines // every machine that has reported itself to the zookeeper - targets map[string]string // what versions the machines should be running - upgrade map[string]bool // use this to trigger builds - myGui *prep.GuiPrep // the gui toolkit handle - machinesWin *gadgets.GenericWindow // the machines gui window - machinesBox *gui.Node // the machines gui parent box widget - machinesTB *zoopb.MachinesTable // the machines gui table buffer - zood *stdTableWin // the zood version window + pp *arg.Parser // for parsing the command line args. Yay to alexf lint! + hostname string // my fqdn dns zookeeper hostname + pollDelay time.Duration // how often to report our status + dog *time.Ticker // the watchdog timer + dogchan chan bool // can kill the watchdog + distro string // debian,redhat,gentoo,macos,wincrap + packages *zoopb.Packages // installed packages and versions + machines *zoopb.Machines // every machine that has reported itself to the zookeeper + targets map[string]string // what versions the machines should be running + upgrade map[string]bool // use this to trigger builds + myGui *prep.GuiPrep // the gui toolkit handle + machinesWin *gadgets.GenericWindow // the machines gui window + machinesBox *gui.Node // the machines gui parent box widget + machinesTB *zoopb.MachinesTable // the machines gui table buffer + zood *stdTableWin // the zood version window + machinesfile string // where the machines.pb file should be stored }