Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
413 stars 203 forks source link

Fields in host templates: "is true (or set)" does not render correctly #1979

Open netzwerkgoettin opened 5 years ago

netzwerkgoettin commented 5 years ago

Hi,

Expected Behavior

in my setup, a host template offers to fill in a datafield. When it has content, a second data field should appear. I realized that via tab "Fields" in host template definition - the second field is marked "mandatory" and when the first field "is true (or set)". It worked on 1.6.2. It stopped working after upgrading to 1.7.0.

Current Behavior

Even when I fill field1, field2 does not appear. It seems the "is true" check goes wrong.

Possible Solution

Seems something changed here since 1.6.2 - you could revert it? ;)

Steps to Reproduce (for bugs)

I tried with other fields. Comparisons like snmp_version = 1 or similar work fine, just "is true" fails.

Your Environment

If you think I simply made something wrong - please tell me. I have no idea what to change :)

Thanks a lot, Marianne

Thomas-Gelf commented 5 years ago

Hi @sysadmama,

it took me some while to reproduce this, thanks for reporting the issue. snmp_version = 1 fooled me, because with that value it worked for me on both v1.6.x and v1.7.x. Checking version = 2 fails on both of them, at least in my tests.

Unfortunately I cannot fix this without cloning the whole Filter logic into the Director project to allow custom tweaks. That forces me to pin this fix to the next major version, as a workaround please use snmp_version > 0 - that should work just fine.

Cheers, Thomas

Thomas-Gelf commented 5 years ago

Screen recording of a full working example, snmp_address is the one that should have been triggered by is true (or set). With > 0 it works:

director_snmp_settings

Thomas-Gelf commented 5 years ago

NB: this uses the current master, Field Categories are not available on v1.7.x. Apart from that, the very same example should work the same way on v1.7.x too.

netzwerkgoettin commented 5 years ago

Hi Tom,

thank you very much for reproducing this.

Cheers, Marianne