diff options
| author | Jeff Carr <[email protected]> | 2024-10-26 12:32:37 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-26 12:32:37 -0500 |
| commit | 07ef0b9f5bad28d5e280f7cfb55feafd36b35e80 (patch) | |
| tree | b6fc722bff1826069dffbd285657c89c9db73fe5 /http.go | |
| parent | 783a06b050048e22aac9fcc1520ca43c40226f14 (diff) | |
xml generation works
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -60,7 +60,18 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if tmp == "/start" { start := r.URL.Query().Get("start") - xml := "/root/jcarr/machines/autostart/" + start + ".xml" + xml := "/tmp/" + start + ".xml" + if shell.Unlink(xml) { + fmt.Fprintln(w, "START FAILED") + fmt.Fprintln(w, "error =", "could not remove existing xml file", xml) + fmt.Fprintln(w, "error =", "file still exists after unlink") + return + } + if err := newStart(start); err != nil { + fmt.Fprintln(w, "START FAILED") + fmt.Fprintln(w, "error =", err) + return + } cmd := []string{"virsh", "create", xml} fmt.Fprintln(w, "Handling URL:", tmp, "start droplet") |
