Story #237
closedthe "Criteria" object just accepts anything the user gives it
0%
Description
++ This bug was initially created as a clone of Bugzilla Bug #1111570 ++
Description of problem:
Description of problem:
It's possible to regenerate applicability data for a nonexisting repo. It returns 200 OK and spawned task reports successful state.
Version-Release number of selected component (if applicable):
rpm -qa pulp-server
pulp-server-2.4.0-0.20.beta.el6.noarch
How reproducible:
always
Steps to Reproduce:
pulp-admin -u admin -p admin rpm repo list
--------------------------------------------------------------------
RPM Repositories
--------------------------------------------------------------------
Id: gena
Display Name: gena
Description: None
Content Unit Counts:
Rpm: 3
pulp-admin -u admin -p admin rpm repo uploads rpm --repo-id gena --file=dog-4.23-1.noarch.rpm
--------------------------------------------------------------------
Unit Upload
--------------------------------------------------------------------
Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: dog-4.23-1.noarch.rpm
... completed
Creating upload requests on the server...
[==================================================] 100%
Initializing: dog-4.23-1.noarch.rpm
... completed
Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.
Uploading: dog-4.23-1.noarch.rpm
[==================================================] 100%
2423/2423 bytes
... completed
Importing into the repository...
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Task Succeeded
Deleting the upload request...
... completed
curl -i -H "Accept: application/json" -X POST -k -u admin:admin -d '{ "repo_criteria": { "filters": {"id": {"$in": ["cheburahska"]}}}}' 'https://localhost/pulp/api/v2/repositories/actions/content/regenerate_applicability/'
HTTP/1.1 202 Accepted
Date: Fri, 20 Jun 2014 11:08:02 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Encoding: utf-8
Content-Length: 172
Connection: close
Content-Type: application/json
{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/b75c6b4d-8725-4808-b1da-91b35b2281a4/", "task_id": "b75c6b4d-8725-4808-b1da-91b35b2281a4"}], "result": null, "error": null}
pulp-admin -u admin -p admin tasks details --task-id="b75c6b4d-8725-4808-b1da-91b35b2281a4"
--------------------------------------------------------------------
Task Details
--------------------------------------------------------------------
Operations: content_applicability_regeneration
Resources:
State: Successful
Start Time: 2014-06-20T11:08:03Z
Finish Time: 2014-06-20T11:08:03Z
Result: N/A
Task Id: b75c6b4d-8725-4808-b1da-91b35b2281a4
Progress Report:
Expected results:
400 - if one or more of the parameters is invalid
--- Additional comment from igulina@redhat.com at 06/20/2014 15:00:36 ---
It's the same for a nonexistent consumer
pulp-consumer -p admin status
This consumer is registered to the server
[localhost] with the ID [cheburashka].
curl -i -H "Accept: application/json" -X POST -k -u admin:admin -d '{ "consumer_criteria": { "filters": {"id": {"$in": ["gena"]}}}}' 'https://localhost/pulp/api/v2/consumers/actions/content/regenerate_applicability/'
HTTP/1.1 202 Accepted
Date: Fri, 20 Jun 2014 14:37:48 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Encoding: utf-8
Content-Length: 172
Connection: close
Content-Type: application/json
{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/8ec8c11e-8fcf-479b-99ae-81bce34a9344/", "task_id": "8ec8c11e-8fcf-479b-99ae-81bce34a9344"}], "result": null, "error": null}
pulp-admin -u admin -p admin tasks details --task-id="8ec8c11e-8fcf-479b-99ae-81bce34a9344"
--------------------------------------------------------------------
Task Details
--------------------------------------------------------------------
Operations: content_applicability_regeneration
Resources:
State: Successful
Start Time: 2014-06-20T14:37:49Z
Finish Time: 2014-06-20T14:37:49Z
Result: N/A
Task Id: 8ec8c11e-8fcf-479b-99ae-81bce34a9344
Progress Report:
--- Additional comment from skarmark@redhat.com at 06/20/2014 16:37:51 ---
Irina,
Providing a filer with non-existing consumer or repo id is not considered an invalid parameter. It is a valid filter parameter which just doesn't match any existing repos or consumers. This would have been a valid bug if we were using exact consumer and repo ids instead of filters. Closing as not a bug.
--- Additional comment from igulina@redhat.com at 06/30/2014 17:13:42 ---
On 06/24/2014 08:54 AM, Irina Gulina wrote:
Sayli,
On https://bugzilla.redhat.com/show_bug.cgi?id=1111570
What to do if one makes a typo in a repo name or consumer? How s/he will be able to notice that applicability data will not be generated, if 200 OK is returned?
Regards,
Irina
There is no current way to handle that right now and that is pretty much
the case with all the apis accepting criteria. Maybe we can create an
RFE to change such APIs to return a dictionary with list that results
after applying filters, like in this case it will contain a list of
consumers and a list of repos that we are using to generate applicability.
--
Sayli Karmarkar
--- Additional comment from igulina@redhat.com at 09/08/2014 14:40:44 ---
Created attachment 935373
invalid parameter
--- Additional comment from igulina@redhat.com at 09/08/2014 14:43:00 ---
The "Criteria" object just accepts anything the user gives it
It was found on applicability exampel, but it seems the problem is not unique to applicability
See attachment.
Files
Updated by bmbouter about 5 years ago
- Status changed from NEW to CLOSED - WONTFIX
Updated by bmbouter about 5 years ago
Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.