Note about commenting out j2 configs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I have done this myself a couple of times myself so wanted to be clear that when you comment out regions in j2 it doesn't act like you would expect. Basically, j2 decisions end of lines are 'eaten' and the next line is appended to your previous one. This works great in many places but can kill you in others.

A change like this:
```
# Comment out emails until we fix deeper issue
#{% if env == 'production' %}
#'mail_admins',
#{% endif %}
],
```
will end up with this:
```
# Comment out emails until we fix deeper issue
#                #'mail_admins',
#                ],
```
versus what is expected. If you are commenting out some j2 decision code, always add either a blank line after words OR an addition comment line at the end
```
# Comment out emails until we fix deeper issues
#{% if env == 'production' %}
#'mail_admins',
#{% endif %}
#
```
will go to
```
# Comment out emails until we fix deeper issues
#                #'mail_admins',
#                #
```

The most likely place you will run into this is the giant mess of nagios configs I left for infrastructure. There are many times where you may need to comment out a decision to see if it's the place nagios is currently puking itself.. and you end up with now two places nagios is puking itself. 
--
Stephen Smoogen, Red Hat Automotive
Let us be kind to one another, for most of us are fighting a hard battle. -- Ian MacClaren
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux