Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chef-zero query parser confused by escaped colons #157

Open
patcon opened this issue Aug 14, 2015 · 4 comments
Open

chef-zero query parser confused by escaped colons #157

patcon opened this issue Aug 14, 2015 · 4 comments

Comments

@patcon
Copy link

patcon commented Aug 14, 2015

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>
@patcon
Copy link
Author

patcon commented Aug 14, 2015

The person who created this pastebin seems to have had the same problem:
http://pastie.org/pastes/8663852

@patcon
Copy link
Author

patcon commented Aug 14, 2015

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.

@flatrocks
Copy link

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'

@patcon
Copy link
Author

patcon commented Oct 7, 2015

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants