[Pulp-list] problem scripting package search using --filters

Kodiak Firesmith kfiresmith at gmail.com
Tue Jun 7 17:52:47 UTC 2016


Hi Folks,

I've been pondering this for a while but I'm stumped.  I've been working on
a script that will let users search for a package across many repos at
once.  The problem is that I can only get past pulp-admin validation when
scripting the search if I basically echo the search into a new bash.

I've tried just about every silly iteration of escapes and whatnot, but
unless I echo it out to a new bash, I get "Validation failed for argument
[--filters]: No JSON object could be decoded".

The reason for all the hoops is that I need the following to work ($1 being
a search regex given when running the script as arg 1:

--filter '{"name":{"$regex":"$1","$options":"i"}}'

Anyhow, here is the script in it's current (ugly) form, which works:
https://paste.fedoraproject.org/375944/65321343/

And here is what the section should be able to look like if it weren't
getting hung up on the JSON validation:

https://paste.fedoraproject.org/375945/32158214/

I want to overcome the silly trick w/ echoing into a new bash before I go
any farther down the rabbit hole with returning custom fields and
parallelizing the searches.

Any ideas?

Thanks!
 - Kodiak Firesmith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20160607/6c695cda/attachment.htm>


More information about the Pulp-list mailing list