generator: added warn when default generator not found and fix error messages

This commit is contained in:
David Allen 2024-11-14 13:45:19 -07:00
parent e93bef79f2
commit 2a9e7c72dc
Signed by: towk
GPG key ID: 793B2924A49B3A3F
2 changed files with 7 additions and 5 deletions

View file

@ -12,6 +12,7 @@ import (
"github.com/OpenCHAMI/configurator/pkg/util"
"github.com/nikolalohinski/gonja/v2"
"github.com/nikolalohinski/gonja/v2/exec"
"github.com/rs/zerolog/log"
)
type (
@ -440,6 +441,7 @@ func GenerateWithTarget(config *configurator.Config, params Params) (FileMap, er
generator, ok = DefaultGenerators[params.Target]
if !ok {
// only load the plugin needed for this target if we don't find default
log.Error().Msg("did not find target in default generators")
generator, err = LoadPlugin(target.PluginPath)
if err != nil {
return nil, fmt.Errorf("failed to load plugin: %w", err)