This commit is contained in:
ston1th 2020-06-01 15:40:52 +02:00
commit 12816a532c
3 changed files with 6 additions and 3 deletions

View file

@ -5,7 +5,7 @@ package pve
import (
"encoding/json"
"errors"
"fmt"
//"fmt"
"io"
"net/http"
"net/url"
@ -43,6 +43,6 @@ func (b httpbody) Reader() io.Reader {
data.Set(k, v)
}
enc := data.Encode()
fmt.Println("--- encoded:", enc)
//fmt.Println("--- encoded:", enc)
return strings.NewReader(enc)
}

View file

@ -32,7 +32,7 @@ func (s *Server) body() (httpbody, error) {
"searchdomain": s.SearchDomain,
}
userdata, err := s.UserData.String()
fmt.Println("--- plain:", userdata)
//fmt.Println("--- plain:", userdata)
body["ciuserdata"] = userdata
for i, n := range s.NetDevices {
body["net"+strconv.Itoa(i)] = n.String()

View file

@ -26,6 +26,9 @@ func UnmarshalUserData(b []byte) (u *UserData, err error) {
return
}
func MarshalUserData(u *UserData) ([]byte, error) {
if u == nil {
return
}
return yaml.Marshal(u)
}