Bug 1058956 - unit filters are ignored if type IDs are not specified
Summary: unit filters are ignored if type IDs are not specified
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: 2.3
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-28 20:24 UTC by Dennis Gregorovic
Modified: 2015-02-28 22:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:00:45 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 393 0 None None None Never

Description Dennis Gregorovic 2014-01-28 20:24:08 UTC
If you query /pulp/api/v2/repositories/my_repo/search/units/ with

{'criteria': {'fields': {'unit': ['filename']}, 'type_ids': ['rpm'], 'filters': {}}}

you will get results like:

...
  u'metadata': {u'_id': u'eb6fa0ea-0bff-4fe6-854b-68364f1bae00',
                u'filename': u'abrt-addon-kerneloops-2.1.11-2.el7.x86_64.rpm'},
...

If you omit the type_ids:

{'criteria': {'fields': {'unit': ['filename']}, 'filters': {}}}

you will get results like:

...
   u'metadata': {u'_content_type_id': u'rpm',
                u'_id': u'eb6fa0ea-0bff-4fe6-854b-68364f1bae00',
                u'_last_updated': 1390620260.0,
                u'_ns': u'units_rpm',
                ...

i.e. the fields part of the criteria is ignored and all fields are returned.  I believe that this is a bug.  If it's intentional, please update the documentation.  Thanks.

Comment 1 Brian Bouterse 2015-02-28 22:00:45 UTC
Moved to https://pulp.plan.io/issues/393


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