lang: Plumb through the unified state facility

This commit is contained in:
James Shubin
2024-07-01 14:47:04 -04:00
parent d326917432
commit 4e18c9c67a
6 changed files with 49 additions and 29 deletions

View File

@@ -49,6 +49,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/interpolate"
"github.com/purpleidea/mgmt/lang/parser"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/lang/unification"
"github.com/purpleidea/mgmt/pgraph"
"github.com/purpleidea/mgmt/util"
@@ -287,11 +288,12 @@ func (obj *GAPI) Cli(info *gapi.Info) (*gapi.Deploy, error) {
return nil, errwrap.Wrapf(err, "could not get default solver")
}
unifier := &unification.Unifier{
AST: iast,
Solver: solver,
Strategy: unificationStrategy,
Debug: debug,
Logf: unificationLogf,
AST: iast,
Solver: solver,
Strategy: unificationStrategy,
UnifiedState: types.NewUnifiedState(),
Debug: debug,
Logf: unificationLogf,
}
startTime := time.Now()
unifyErr := unifier.Unify(context.TODO())