Ansible Error: local variable 'value' referenced before assignment

Ansible Error: local variable 'value' referenced before assignment

当尝试检索 JSON 的某些字段时,ansible 抛出此错误:

UnboundLocalError: local variable 'value' referenced before assignment

JSON 的结构、字段名称和缩进似乎不是问题所在。

谢谢。

问题是 JSON 的源文件中使用的特殊 space 字符。转换为 ANSI 后,它们显示为  。用常规 space 字符替换它们后,错误消息消失了。