Skip to content

Commit d4eb010

Browse files
ENT-13824: Error on rval call that are not builtin-functions inside vars-promise
Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
1 parent 0e94a6f commit d4eb010

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/cfengine_cli/lint.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,14 @@ def _lint_node(node: Node, policy_file: PolicyFile, state: State) -> int:
515515
f"Error: Call to unknown function / bundle / body '{name}' {location}"
516516
)
517517
return 1
518+
if state.strict and (
519+
name not in BUILTIN_FUNCTIONS and state.promise_type == "vars"
520+
):
521+
_highlight_range(node, lines)
522+
print(
523+
f"Error: Call to unknown function '{name}' inside 'vars'-promise {location}"
524+
)
525+
return 1
518526
return 0
519527

520528

0 commit comments

Comments
 (0)