From 2152a6477fc93581948ef42acea72bb97b7aae49 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 16 Feb 2025 12:02:47 -0600 Subject: zookeeper is working again --- send.go | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/send.go b/send.go index 2645aea..43efc6e 100644 --- a/send.go +++ b/send.go @@ -14,13 +14,16 @@ import ( func pingStatus() error { var url string url = me.urlbase + "/status?hostname=" + me.forge.Machine.Hostname - msg, err := me.forge.Machine.Packages.Marshal() - if err != nil { - log.Info("proto.Marshal() failed:", err) - return err - } - log.Info("proto Marshal len =", len(msg)) - body, err := me.forge.HttpPost(url, msg) + /* + msg, err := me.forge.Machine.Packages.Marshal() + if err != nil { + log.Info("proto.Marshal() failed:", err) + return err + } + log.Info("proto Marshal len =", len(msg)) + */ + + body, err := me.forge.HttpPostMachine(url) if err != nil { log.Info("httpPost() failed:", err) return err @@ -42,23 +45,21 @@ func pingStatus() error { func sendMachine(s string) error { var url string url = me.urlbase + "/machine" - msg, err := me.forge.Machine.Marshal() - if err != nil { - log.Info("proto.Marshal() failed:", err) - return err - } - body, err := me.forge.HttpPost(url, msg) + body, err := me.forge.HttpPostMachine(url) if err != nil { log.Info("httpPost() failed: url", url) log.Info("httpPost() failed:", err) + log.Info("httpPost() data:", string(body)) return err } + out := strings.TrimSpace(string(body)) + log.Info("httpPost() data:", out, len(body)) test := strings.TrimSpace(string(body)) // log.Info("virtigo returned body:", test) for _, line := range strings.Split(test, "\n") { if line == "upgrade" { - log.Info(s, "zookeeper is healthy", len(msg)) + log.Info(s, "zookeeper is healthy") me.failcount = 0 } else if line == "kill" { os.Exit(0) -- cgit v1.2.3