You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I use jinja in an SLS file, I get this error. Any ideas?
>>> from salt_lsp.parser import parse
>>> parse("""vim_installed:
... pkg.installed:
... - pkgs:
... - vim""")
Tree(start=Position(line=0, col=0), end=Position(line=3, col=11), includes=None, extend=None, states=[StateNode(start=Position(line=0, col=0), end=Position(line=3, col=11), identifier='vim_installed', states=[StateCallNode(start=Position(line=1, col=2), end=Position(line=3, col=11), name='pkg.installed', parameters=[StateParameterNode(start=Position(line=2, col=4), end=Position(line=3, col=11), name='pkgs', value=[TokenNode(start=Position(line=3, col=6), end=Position(line=3, col=7), token=BlockEntryToken()), TokenNode(start=Position(line=3, col=8), end=Position(line=3, col=11), token=ScalarToken(plain=True, style=None, value='vim'))])], requisites=[])])])
>>> parse("""{%- set pkg = "vim" -%}
... vim_installed:
... pkg.installed:
... - pkgs:
... - {{ pkg }}""")
Traceback (most recent call last):
File "/home/vagrant/.pyenv/versions/3.8.13/lib/python3.8/site-packages/salt_lsp/parser.py", line 700, in parse
for token in tokens:
File "/home/vagrant/.pyenv/versions/3.8.13/lib/python3.8/site-packages/yaml/__init__.py", line 64, in scan
while loader.check_token():
File "/home/vagrant/.pyenv/versions/3.8.13/lib/python3.8/site-packages/yaml/scanner.py", line 116, in check_token
self.fetch_more_tokens()
File "/home/vagrant/.pyenv/versions/3.8.13/lib/python3.8/site-packages/yaml/scanner.py", line 258, in fetch_more_tokens
raise ScannerError("while scanning for the next token", None,
yaml.scanner.ScannerError: while scanning for the next token
found character '%' that cannot start any token
in "<unicode string>", line 1, column 2:
{%- set pkg = "vim" -%}
^
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vagrant/.pyenv/versions/3.8.13/lib/python3.8/site-packages/salt_lsp/parser.py", line 753, in parse
return Parser(document).parse()
File "/home/vagrant/.pyenv/versions/3.8.13/lib/python3.8/site-packages/salt_lsp/parser.py", line 708, in parse
if node.start and err.context_mark.column < node.start.col:
AttributeError: 'NoneType' object has no attribute 'column'
>>>
The text was updated successfully, but these errors were encountered:
Whenever I use jinja in an SLS file, I get this error. Any ideas?
Yes, jinja2 parsing is not yet implemented. We currently just parse the
sls file as pure yaml. If there are any jinja2 instructions in it,
parsing will fail.
Whenever I use jinja in an SLS file, I get this error. Any ideas?
The text was updated successfully, but these errors were encountered: