diff --git a/lang/funcs/structs/const.go b/lang/funcs/structs/const.go index 8f18c6ab24..7b6e218784 100644 --- a/lang/funcs/structs/const.go +++ b/lang/funcs/structs/const.go @@ -40,7 +40,8 @@ type ConstFunc struct { // String returns a simple name for this function. This is needed so this struct // can satisfy the pgraph.Vertex interface. func (obj *ConstFunc) String() string { - return ConstFuncName + //return fmt.Sprintf("%s: %s(%s)", ConstFuncName, obj.Value.Type().String(), obj.Value.String()) + return fmt.Sprintf("%s(%s)", obj.Value.Type().String(), obj.Value.String()) } // Validate makes sure we've built our struct properly. diff --git a/lang/funcs/structs/var.go b/lang/funcs/structs/var.go index 8fef13306d..3d3d66fc79 100644 --- a/lang/funcs/structs/var.go +++ b/lang/funcs/structs/var.go @@ -20,6 +20,7 @@ package structs import ( "context" "fmt" + "strings" "github.com/purpleidea/mgmt/lang/interfaces" "github.com/purpleidea/mgmt/lang/types" @@ -46,7 +47,8 @@ type VarFunc struct { // String returns a simple name for this function. This is needed so this struct // can satisfy the pgraph.Vertex interface. func (obj *VarFunc) String() string { - return VarFuncName + // XXX: This is a bit of a temporary hack to display it nicely. + return fmt.Sprintf("%s(%s)", VarFuncName, strings.TrimPrefix(obj.Edge, "var:")) } // Validate makes sure we've built our struct properly.