Changed generate functions to return config as bytes

This commit is contained in:
David J. Allen 2024-04-11 12:44:32 -06:00
parent 977ddf8a79
commit 80c9eb29a6
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
2 changed files with 9 additions and 7 deletions

View file

@ -86,12 +86,13 @@ func (s *Server) Start(config *configurator.Config) error {
}
// generate a new config from that data
err = g.GenerateDHCP(config, eths)
b, err := g.GenerateDHCP(config, eths)
if err != nil {
logrus.Errorf("failed to generate DHCP: %v", err)
w.Write([]byte("An error has occurred."))
return
}
w.Write(b)
}
})
r.HandleFunc("/templates", func(w http.ResponseWriter, r *http.Request) {