summaryrefslogtreecommitdiff
path: root/send.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-16 12:02:47 -0600
committerJeff Carr <[email protected]>2025-02-16 12:05:32 -0600
commit2152a6477fc93581948ef42acea72bb97b7aae49 (patch)
tree2d19a89a4398cee878db1366748e9ffb0b40af99 /send.go
parent94b1881d41ff33cfce293c5becd2c28377de7b04 (diff)
Diffstat (limited to 'send.go')
-rw-r--r--send.go29
1 files 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)