Skip to content

Commit 2d43ee6

Browse files
authored
Merge pull request #104 from olehermanse/strict
Fixed issue with expanding variables for bundle names
2 parents 122f36c + e4c4568 commit 2d43ee6

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/cfengine_cli/lint.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,9 @@ def _lint_calling_identifier(
679679
"""
680680
assert node.type == "calling_identifier"
681681
name = _text(node)
682+
if name.startswith("$"):
683+
# Variable expansion so no point in checking if it's defined
684+
return
682685
qualified_name = _qualify(name, state.namespace)
683686
is_bundle = qualified_name in state.bundles
684687
is_body = qualified_name in state.bodies
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
bundle agent my_bundle_name(arg)
2+
{
3+
reports:
4+
"$(arg)";
5+
}
6+
7+
bundle agent main
8+
{
9+
vars:
10+
"handlers" slist => { "my_bundle_name" };
11+
"args" slist => { "foo" };
12+
13+
methods:
14+
"" usebundle => $(handlers)(@(args));
15+
}

0 commit comments

Comments
 (0)