You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got _ElementStringResult)" when trying to retrieve attribute value
#14
I'm using the following Ansible task in an attempt to retrieve a value from a remote-side XML file:
- name: try to get existing XML valuexml: > file=/home/XXX/settings.xml xpath='/settings/setting[@id="setting.setting_key"]/@value' print_match=trueregister: existing_xml_value
The task fails with this output:
TASK: [playbook | try to get existing XML value] ************************
failed: [XXX] => {"failed": true, "parsed": false}
BECOME-SUCCESS-XXX
Traceback (most recent call last):
File "/home/XXX/.ansible/tmp/ansible-tmp-XXX/xml", line 1937, in <module>
main()
File "/home/XXX/.ansible/tmp/ansible-tmp-XXX/xml", line 290, in main
print_match(x, xpath, module)
File "/home/XXX/.ansible/tmp/ansible-tmp-XXX/xml", line 100, in print_match
match_xpaths.append(tree.getpath(m))
TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got _ElementStringResult)
OpenSSH_XXX, OpenSSL XXX XXX
debug1: Reading configuration data /home/XXX/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
Shared connection to XXX closed.
I may be doing it wrong as there's no explicit documentation at this time for retrieving actual values (as opposed to counts). Is this operation supported?
I would guess that the OpenSSH output in the module error output is a module bug, since no other module I've worked with has such output when it fails.
The text was updated successfully, but these errors were encountered:
I'm using the following Ansible task in an attempt to retrieve a value from a remote-side XML file:
The task fails with this output:
I may be doing it wrong as there's no explicit documentation at this time for retrieving actual values (as opposed to counts). Is this operation supported?
I would guess that the OpenSSH output in the module error output is a module bug, since no other module I've worked with has such output when it fails.
The text was updated successfully, but these errors were encountered: