On 4/30/20 10:37 AM, Harsh Jain 2K18_CO_140 wrote:
Hey everyone, i was trying to modify the test for downing a non existent profile using blocks and rescue ,and I'm getting this error An unhandled exception occurred while templatinga really big JSON object which boils down to this Unexpected templating type error occurred on ({{ network_connections | json_query('[*][ieee802_1x]') | flatten | count > 0 }}): 'NoneType' object is not iterable" which I guess is due to an emty object being returned ? I'm not sure though what exactly this returns or is supposed to return and I'm having some trouble finding a way to fix this . Could someone please help guide me in the right direction ?
Seems like a bug, but hard to say without knowing what your input `network_connections` looks like.
Does it work if you make this change?
diff --git a/defaults/main.yml b/defaults/main.yml index 6b15964..d3977cb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -22,7 +22,7 @@ network_provider: "{{ network_provider_current }}"
# wpa_supplicant is required if any ieee802_1x connections are defined wpa_supplicant_required: "{{ network_connections | - json_query('[*][ieee802_1x]') | flatten | count > 0 }}" + selectattr('ieee802_1x', 'defined') | list | count > 0 }}" _network_packages_default_802_1x: ["{% if wpa_supplicant_required %}wpa_supplicant{% endif %}"]
Any help is appreciated Thanks, Harsh
systemroles mailing list -- systemroles@lists.fedorahosted.org To unsubscribe send an email to systemroles-leave@lists.fedorahosted.org 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.fedorahosted.org/archives/list/systemroles@lists.fedorahosted....