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

[BUG] if directive #295

Open
hegyre opened this issue Oct 20, 2022 · 0 comments
Open

[BUG] if directive #295

hegyre opened this issue Oct 20, 2022 · 0 comments
Labels

Comments

@hegyre
Copy link

hegyre commented Oct 20, 2022

Your setup

Formula commit hash / release tag

2.4.0

Versions reports (master & minion)

Salt Version:
Salt: 3000.3

Pillar / config used

            - location ^~ /var/_cron/:
              - include:
                - /etc/nginx/fastcgi_params
              - fastcgi_param:
                - SCRIPT_FILENAME $document_root$fastcgi_script_name
              - fastcgi_pass:
                - 127.0.0.1:9001
              - fastcgi_connect_timeout:
                - 3m
              - fastcgi_read_timeout:
                - 3m
              - if: ($exclusion_cron = "0") { return 403; }
              - fastcgi_send_timeout:
                - 3m
              


Bug details

Describe the bug

When migrating formula from 0.56.x to 2.4.0, I had to do small pillar updates (that's ok).
However, for the if directive, the behavior is a bit special:
The next directive - or the location closing bracket - is now on the same line as the if directive...

@@ -193,8 +192,8 @@
                           fastcgi_pass 127.0.0.1:9001;
                           fastcgi_connect_timeout 3m;
                           fastcgi_read_timeout 3m;
                  -        fastcgi_send_timeout 3m;
                  -        if ($exclusion_cron = "0") { return 403; }
                  +
                  +        if ($exclusion_cron = "0") { return 403; }        fastcgi_send_timeout 3m;
                       }

Expected behaviour

Next directive (or the location closing bracket) must be on a new line

Attempts to fix the bug

I found a workaround:

              - if: |
                  ($exclusion_cron = "0") { return 403; }

With that pipe, the next directive is on the new line, but it's a bit ugly and it adds an additional blank newline...

Additional context

This pillar code worked fine with this formula before 1.0.0.
I've upgraded the formula to 2.4.0, and after fixing small other things, this is the only remaining one...

@hegyre hegyre added the bug label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant