Bug 874243
Summary: | Requesting package profile on consumer without a package profile results in error | ||
---|---|---|---|
Product: | [Retired] Pulp | Reporter: | Preethi Thomas <pthomas> |
Component: | consumers | Assignee: | Jeff Ortel <jortel> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Preethi Thomas <pthomas> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 2.0.6 | CC: | jsherril, skarmark |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | Sprint 42 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 872724 | Environment: | |
Last Closed: | 2013-01-09 17:05:34 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 872724 | ||
Bug Blocks: | 854726 |
Description
Preethi Thomas
2012-11-07 19:02:12 UTC
Updated to return 404 when the profile does not exist. build: 2.0.6-0.3.beta To test this:
Using the CLI, bind a consumer to a repository. Then using pic do:
>>> from pprint import pprint
>>> from pulp.common import pic
>>> pic.connect()
>>> pprint (pic.GET('/v2/tasks/'))
...
{u'call_request_group_id': u'e3882d65-d687-45d1-8ad0-a3ef59156d81',
u'call_request_id': u'e3b8ff4f-4cfb-4455-a8fc-dfe15d0ae47e',
u'call_request_tags': [u'pulp:consumer:jortel',
u'pulp:repository:jeff',
u'pulp:repository_distributor:yum_distributor',
u'pulp:action:agent_bind'],
u'dependency_failures': {},
u'exception': None,
u'finish_time': None,
u'principal_login': u'SYSTEM',
u'progress': {},
u'reasons': [],
u'response': u'accepted',
u'result': None,
u'schedule_id': None,
u'start_time': u'2012-12-05T20:27:42Z',
u'state': u'running',
u'tags': [u'pulp:consumer:jortel',
u'pulp:repository:jeff',
u'pulp:repository_distributor:yum_distributor',
u'pulp:action:agent_bind'],
u'task_group_id': u'e3882d65-d687-45d1-8ad0-a3ef59156d81',
u'task_id': u'e3b8ff4f-4cfb-4455-a8fc-dfe15d0ae47e',
u'traceback': None}])
...
Note: the 'tags' attribute.
Repeat for unbind.
Updated wrong bug :( Disregard #c3 To test this one, register a consumer but make sure the agent is not running. This will ensure that no profile exits for the consumer.
Then using pic:
>>> pprint(pic.GET('/v2/consumers/jortel/profiles/rpm/'))
Response Body
{
"exception": null,
"traceback": null,
"_href": "/pulp/api/v2/consumers/jortel/profiles/rpm/",
"error_message": "Missing resource(s): profile_id={'content_type': u'rpm', 'consumer_id': u'jortel'}",
"http_request_method": "GET",
"http_status": 404,
"resources": {
"profile_id": {
"content_type": "rpm",
"consumer_id": "jortel"
}
}
}
Note a 404.
verified [root@preethi ~]# rpm -q pulp-server pulp-server-2.0.6-0.11.beta.noarch [root@preethi ~]# python Python 2.7.3 (default, Apr 30 2012, 21:18:11) [GCC 4.7.0 20120416 (Red Hat 4.7.0-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pprint import pprint >>> from pulp.common import pic >>> pic.connect() >>> pprint(pic.GET('/v2/consumers/jortel/profiles/rpm/')) Response Body { "exception": null, "traceback": null, "_href": "/pulp/api/v2/consumers/jortel/profiles/rpm/", "error_message": "Missing resource(s): profile_id={'content_type': u'rpm', 'consumer_id': u'jortel'}", "http_request_method": "GET", "http_status": 404, "resources": { "profile_id": { "content_type": "rpm", "consumer_id": "jortel" } } } Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/site-packages/pulp/common/pic.py", line 121, in GET return _request('GET', path) File "/usr/lib/python2.7/site-packages/pulp/common/pic.py", line 114, in _request (response.status, response_body)) pulp.common.pic.RequestError: Server response: 404 {u'exception': None, u'traceback': None, u'_href': u'/pulp/api/v2/consumers/jortel/profiles/rpm/', u'error_message': u"Missing resource(s): profile_id={'content_type': u'rpm', 'consumer_id': u'jortel'}", u'http_request_method': u'GET', u'http_status': 404, u'resources': {u'profile_id': {u'content_type': u'rpm', u'consumer_id': u'jortel'}}} >>> Pulp v2.0 released |