Red Hat Bugzilla – Bug 1273589
[abrt] ansible: shlex.py:172:read_token:ValueError: No closing quotation
Last modified: 2016-06-17 13:30:20 EDT
Description of problem:
Tried to run a ping across my inventory. Added a password with double quotes in it, which seems to be the cause of the crash.
Version-Release number of selected component:
cmdline: /usr/bin/python /usr/bin/ansible community -i ./hosts-independent -m ping
runlevel: N 5
shlex.py:172:read_token:ValueError: No closing quotation
Traceback (most recent call last):
File "/usr/bin/ansible", line 197, in <module>
(runner, results) = cli.run(options, args)
File "/usr/bin/ansible", line 121, in run
inventory_manager = inventory.Inventory(options.inventory, vault_password=vault_pass)
File "/usr/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 128, in __init__
self.parser = InventoryParser(filename=host_list)
File "/usr/lib/python2.7/site-packages/ansible/inventory/ini.py", line 43, in __init__
File "/usr/lib/python2.7/site-packages/ansible/inventory/ini.py", line 47, in _parse
File "/usr/lib/python2.7/site-packages/ansible/inventory/ini.py", line 108, in _parse_base_groups
tokens = shlex.split(line)
File "/usr/lib64/python2.7/shlex.py", line 279, in split
File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
Local variables in innermost frame:
self: <shlex.shlex instance at 0x7f0cf6a6bdd0>
escapedstate: ' '
Created attachment 1084874 [details]
Created attachment 1084875 [details]
Added where? as a vault password? as a variable?
If you escape it with \ does it work?
Sorry for the delay, I haven't had the time to respond and I had already fixed the problem variable.
In this case it was in an ansible_ssh_pass= variable in an inventory file.
Example: foo.bar.com ansible_ssh_pass="N#qd3e'$"
Yes, using an escape works, but receiving a traceback and abrt message is not good.
Would you be willing to file an upstream issue on this? Or shall I?
Ansible 2.x seems to have fixed this. Closing.