Check that variable is defined and is not empty
kostiantyn-nemchenko opened this issue · comments
Kostiantyn Nemchenko commented
An ugly condition (e.g. if not( (patroni_etcd_url is none) or (patroni_etcd_url | trim == '') )
) for checking that variable is defined and is not empty should be improved somehow.
Perhaps, a custom Jinja filter will do the trick
Kostiantyn Nemchenko commented
TODO: Take a look at the second parameter of the default
filter default(value, default_value=u’’, boolean=False)
If the value isn’t defined, default
will display what’s in the default_value
field. Passing in a true
as the second parameter will return the default value if the value is defined but blank.