Open LukeDRussell opened 5 years ago
@LukeDRussell I am unable to reproduce the issue. network-engine sets the key to null if there is no match which caused the following test failure which is expected, it didn't hang for me. I think this might be related to connection plugin, copying @Qalthos here.
TASK [15.5.1.txt - test `show version` parser] ***************************************************************************************************
fatal: [localhost]: FAILED! => {
"assertion": "system.restart_time == '09:58:28'",
"changed": false,
"evaluated_to": false,
"msg": "Assertion failed"
}
to retry, use: --limit @/home/tguha/workspace/cisco_ios/tests/test_parser_templates.retry
PLAY RECAP ***************************************************************************************************************************************
localhost : ok=22 changed=0 unreachable=0 failed=1
Ack, I'll have to find another way to reproduce this.
ISSUE TYPE
ANSIBLE VERSION
Network OS
Not relevant
SUMMARY
When you construct a json_template that references a non-existing (or perhaps null) parsed variable, ansible hangs. It should fail explicitly with a useful message.
STEPS TO REPRODUCE
From inside ansible-network.cisco_ios
ansible-playbook tests/test_parser_templates.yaml -i tests/inventory
EXPECTED RESULTS
When network engine tries to construct the key
restart_time
(link) which is null / doesn't exist because the previous regex didn't match anything, it should produce a meaningful error.ACTUAL RESULTS
The playbook hangs at this point for all hosts, and must Ctrl+C to break it.