Bug 735393

Summary: pulp package search via api fails with error (and solution isn't documented)
Product: [Retired] Pulp Reporter: Justin Sherrill <jsherril>
Component: z_otherAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedKeywords: Triaged
Target Milestone: ---   
Target Release: Sprint 28   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Sherrill 2011-09-02 14:53:15 UTC
Perform the following command:


curl --insecure -u admin:admin -d '{"name":"kernel"}'  -H "Accept: application/json" -H "content-type: application/json" -X POST https://localhost.localdomain/pulp/api/services/search/packages/


The server will throw the following error:


2011-09-02 10:43:08,560 2487:140672166250240: pulp.server.webservices.controllers.decorators:ERROR: decorators:52 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 48, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 127, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/services.py", line 124, in POST
    regex = data["regex"]
KeyError: 'regex'



After talking with prad, there is a 'regex' option that is

a) should be optional (defaulting to false) but isn't
b) should be documented but isn't (regex isn't in any of the documentation for package search)



So ideally both of the above would be fixed.

Comment 1 John Matthews 2011-09-08 17:53:09 UTC
Changed pulp webservices services.py to allow 'regex' to be an optional.

Commit here:
http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=f545dc29083c3df6455d9ff9c3326206e2a05b2e

Comment 2 Jeff Ortel 2011-09-14 20:27:01 UTC
build: 0.231

Comment 3 Preethi Thomas 2011-09-16 15:08:44 UTC
[root@katello-test ~]# rpm -q pulp
pulp-0.0.231-1.el6.noarch
[root@katello-test ~]# 


[root@katello-test ~]# curl --insecure -u admin:admin -d '{"name":"kernel"}'  -H "Accept:application/json" -H "content-type: application/json" -X POST https://localhost.localdomain/pulp/api/services/search/packages/[{"name": "kernel", "checksum": {"sha256": "c6eb442973962dc2a7d635ab1b830127b26a81d2d94ee5d6f04ef263e7348461"}, "repos": ["f14", "f14-clone"], "filename": "kernel-2.6.35.6-45.fc14.x86_64.rpm", "epoch": "0", "version": "2.6.35.6", "release": "45.fc14", "_id": "874ce2aa-8bb1-4ec7-aedb-caf96e3d31c3", "arch": "x86_64", "id": "874ce2aa-8bb1-4ec7-aedb-caf96e3d31c3"}][root@katello-test ~]#

Comment 4 Preethi Thomas 2012-02-24 20:17:22 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 5 Preethi Thomas 2012-02-24 20:18:24 UTC
Pulp v1.0 is released.