chef-zero query parser confused by escaped colons
This query works: recipes:elkstack\:\:default
This query doesn't work: recipes:elkstack\:\:default AND chef_environment:digitalocean_testing
This query works: recipes:elkstack* AND chef_environment:digitalocean_testing
The error it throws is:
ERROR: #<RuntimeError: Error on token ':' at 19 of '(recipes:elkstack::default AND chef_environment:digitalocean_testing)': Unexpected binary operator>
The person who created this pastebin seems to have had the same problem: http://pastie.org/pastes/8663852
Messed around with the parser code, but couldn't get it working :( Ended up side-stepping the issue by simply using a roles:elkstack_server expression, but that's pretty rigid for my setup.
If you use this:
"recipes:elkstack\:\:default"
with search, it just gets translated to "recipes:elkstack::default". (Escaping a colon has no effect.) You need to escape the "" so it is retained as part of the string.
This:
"recipes:elkstack\\:\\:default"
should work. Or this:
'recipes:elkstack\:\:default'
Thanks! I could've sworn I tried that, but I'll give it a go when I'm next working on that cookbook, and report back :)