Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive for Jinja variables regex (test provided + failing CI output) #283

Open
myii opened this issue Jun 4, 2022 · 0 comments
Open
Labels
Type: Bug Something isn't working

Comments

@myii
Copy link
Contributor

myii commented Jun 4, 2022

Describe the bug

Encountered a false positive for the Jinja variables check, based on this block:

  file.blockreplace:
    - ...
    - content: |
           DKIM_DOMAIN = ${lc:${domain:$h_from:}}
           DKIM_KEY_FILE = /etc/exim4/dkim/{{ pillar['dkim_private_key'] }}
           DKIM_PRIVATE_KEY = ${if exists{DKIM_KEY_FILE}{DKIM_KEY_FILE}{0}}
           DKIM_SELECTOR = {{ pillar['dkim_selector'] }}

With the error being:

[206] Jinja variables should have spaces before and after: '{{ var_name }}'
.../init.sls:71
           DKIM_DOMAIN = ${lc:${domain:$h_from:}}

To Reproduce

I've provided a failing test here:

As I've mentioned there, it fails within quotes as well:

    - content: 'DKIM_DOMAIN = ${lc:${domain:$h_from:}}'

Here's the failure in GitHub Actions based on that commit:

Note, there's also another commit there, which adjusts the CI so that the yamllint error is resolved and the CI doesn't fail fast (so that all instance failures can be seen):

Let me know if you'd like that in a PR here.

Expected behavior

The regex shouldn't catch this as a failure.

@myii myii added the Type: Bug Something isn't working label Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant