Bug 790909 - Get Package By NVREA api returns results of OR query
Summary: Get Package By NVREA api returns results of OR query
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 1.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 34
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-15 17:27 UTC by Tomas Strachota
Modified: 2013-09-09 16:33 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-25 14:15:06 UTC


Attachments (Terms of Use)

Description Tomas Strachota 2012-02-15 17:27:43 UTC
Description of problem:
Api /repositories/<id>/get_package_by_nvrea/ returns wrong results. It composes OR query instead of AND query from nvrea data.


Version-Release number of selected component (if applicable):
pulp-0.0.265-1.fc16.noarch

Steps to Reproduce:
1. create repo http://tstrachota.fedorapeople.org/dummy_repos/zoo/
2. run
curl -H "Content-Type: application/json" -H "Accept: application/json" -# -X POST -d '{"nvrea": [{"name": "frog"}, {"version":"0.1"}]}' -k -u admin:admin https://localhost/pulp/api/repositories/ACME_Corporation-zoo-zoo/get_package_by_nvrea/
  
Actual results:
Returns all packages in version 0.1

Expected results:
Should return only frog-0.1-1.noarch.rpm

Additional info:

Comment 1 Pradeep Kilambi 2012-04-12 20:47:05 UTC
commit f3ac6dc5173e396e34eeffc68e1b4a40d7b211f3

Comment 2 Jeff Ortel 2012-04-12 22:59:11 UTC
build: 0.282

Comment 3 Preethi Thomas 2012-04-26 19:20:36 UTC
[root@pulp-v1-1-server ~]# rpm -q pulp
pulp-1.1.4-1.fc16.noarch
[root@pulp-v1-1-server ~]# curl -H "Content-Type: application/json" -H "Accept: application/json" -# -X
curl: option -X: requires parameter
curl: try 'curl --help' or 'curl --manual' for more information
[root@pulp-v1-1-server ~]# curl -H "Content-Type: application/json" -H "Accept: application/json" -# -X POST -d '{"nvrea": [{"name": "frog"}, {"version":"0.1"}]}' -k -u admin:admin https://localhost/pulp/api/repositories/zoo/get_package_by_nvrea/
{"frog-0.1-1.noarch.rpm": {"size": 2439, "license": "GPLv2", "vendor": "", "name": "frog", "repo_defined": true, "buildhost": "smqe-ws15", "checksum": {"sha256": "155419d86251249233f9d8016f6012e138ef3a3f5c679c8685de84460e32e3e3"}, "requires": [], "epoch": "0", "download_url": "https://pulp-v1-1-server.usersys.redhat.com//pulp/repos/zoo/frog-0.1-1.noarch.rpm", "filename": "frog-0.1-1.noarch.rpm", "repoids": ["zoo"], "version": "0.1", "provides": ["frog"], "_ns": "packages", "release": "1", "group": "Internet/Applications", "_id": "1b1bd566-f770-459e-890e-b759d15fe074", "arch": "noarch", "id": "1b1bd566-f770-459e-890e-b759d15fe074", "description": "A dummy package of frog"}}[root@pulp-v1-1-server ~]#

Comment 4 Preethi Thomas 2012-05-25 14:15:06 UTC
Pulp v1.1 Release


Note You need to log in before you can comment on or make changes to this bug.