Simplify environment creation for server

This commit is contained in:
Dane Everitt
2020-09-12 21:48:04 -07:00
parent be49e08f4f
commit ce2659fdd7
4 changed files with 13 additions and 33 deletions

View File

@@ -57,7 +57,11 @@ func postCreateServer(c *gin.Context) {
// cycle. If there are any errors they will be logged and communicated back
// to the Panel where a reinstall may take place.
go func(i *installer.Installer) {
i.Execute()
err := i.Server().CreateEnvironment()
if err != nil {
i.Server().Log().WithField("error", err).Error("failed to create server environment during install process")
return
}
if err := i.Server().Install(false); err != nil {
log.WithFields(log.Fields{"server": i.Uuid(), "error": err}).Error("failed to run install process for server")