Closed Mandorath closed 3 years ago
Not sure why markdown code block is ignoring new lines, tried several methods...
@Mandorath Have a look at the edit I made. You need to gate the code block with three backticks and you can add an optional code language for colour highlighting. So that was:
```jinja
{%- if dhcpd.allow %}
{% if dhcpd.allow is iterable and dhcpd.allow is not string %}
{%- for item in dhcpd.allow %}
allow {{ item }};
{%- endfor %}
{%- else %}allow {{ dhcpd.allow }};
{%- endif %}
{%- endif %}
@myii Thanks! I'm still reading myself up on all of this :).
Hello, any progress on this item? It would be nice to have an update on this formula with the bug fixed.
@Mandorath @geertwitter Fix proposed in #52. Feel free to test it out and comment there.
Tricked by @daks (in Slack) into working on this!!
Thanks for the fast response!
@Mandorath @geertwitter Fix has been merged, let us know if there are any problems, either here or in #52.
:tada: This issue has been resolved in version 0.11.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Your setup
Formula commit hash / release tag
The formula used is v0.11.1, I checked the code in the master branch and it has the same problem.
Versions reports (master & minion)
Salt Version: Salt: 2019.2.4
Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: Not Installed docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.8.1 libgit2: Not Installed libnacl: Not Installed M2Crypto: 0.33.0 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.5.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: Not Installed pycryptodome: Not Installed pygit2: Not Installed Python: 3.6.8 (default, Aug 7 2019, 17:28:10) python-gnupg: Not Installed PyYAML: 3.11 PyZMQ: 15.3.0 RAET: Not Installed smmap: Not Installed timelib: Not Installed Tornado: 4.4.2 ZMQ: 4.1.4
System Versions: dist: centos 7.7.1908 Core locale: UTF-8 machine: x86_64 release: 3.10.0-1062.18.1.el7.x86_64 system: Linux version: CentOS Linux 7.7.1908 Core
Pillar / config used
Below an example of the pillar file used. Note the allow key.
Bug details
Describe the bug
When running the formula and adding items 'allow' items in the pillar file they are pasted after each other and after the last item declared before it. This is caused to due to the for loop stripping the new lines. The first option when not specified is dhcpd.use_host_decl_names, which when not specified pastes the allow items behind a commented item.
Output:
use-host-decl-names off;allow booting;allow bootp;
Steps to reproduce the bug
Do not specify the key dhcpd.use_host_decl_names and add several allow items like shown in the pillar example.
Expected behaviour
Output everything with newlines properly like show below.
use-host-decl-names off;
allow booting; allow bootp;
Attempts to fix the bug
Below the dhcp.allow with the allow in its own line
Using the code above will result in the mentioned expected outcome
Additional context