mirror of
https://github.com/davidallendj/configurator.git
synced 2025-12-20 03:27:02 -07:00
Changed generate functions to return config as bytes
This commit is contained in:
parent
977ddf8a79
commit
80c9eb29a6
2 changed files with 9 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue