Issue #317
closed400 is never raised during consumer binding deletion
Description
$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X DELETE -k -u admin:admin -d '{"force":"yes"}' "https://localhost/pulp/api/v2/consumers/new_consumer1/bindings/xxx/yum_distributor/"
HTTP/1.1 202 Accepted
Date: Thu, 26 Feb 2015 09:50:25 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 172
Content-Type: application/json
{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/064ba133-a4a8-491a-8e4f-c1d8c5966ec9/", "task_id": "064ba133-a4a8-491a-8e4f-c1d8c5966ec9"}], "result": null, "error": null}
I expect:
{"http_request_method": "DELETE", "exception": null, "error_message": "Invalid properties: ['force']", "property_names": ["force"], "_href": "/pulp/api/v2/consumers/new_consumer1/bindings/xxx/yum_distributor/", "http_status": 400, "error": {"code": "PLP0015", "data": {"property_names": ["force"], "properties": "['force']"}, "description": "Invalid properties: ['force']", "sub_errors": []}, "traceback": null}
Updated by ipanova@redhat.com almost 10 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ipanova@redhat.com
Updated by bmbouter almost 10 years ago
- Triaged changed from No to Yes
- Severity set to Low
Updated by ipanova@redhat.com over 9 years ago
- Status changed from ASSIGNED to POST
Updated by ipanova@redhat.com over 9 years ago
- Status changed from POST to MODIFIED
Updated by dkliban@redhat.com over 9 years ago
- Status changed from MODIFIED to 5
Updated by igulina@redhat.com over 9 years ago
- Status changed from 5 to ASSIGNED
>> rpm -qa pulp-server
pulp-server-2.7.0-0.3.beta.el7.noarch
For invalid parameter I got 202:
>> pulp-consumer rpm bind --repo-id=zoo_repoBind tasks successfully created:
Task Id: be03d103-44b2-47e7-b01e-3e5d86a5c090
>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X DELETE -k -u admin:admin -d '{"invalid":"yes"}' "https://localhost/pulp/api/v2/consumers/maruska/bindings/zoo_repo/yum_distributor/"
HTTP/1.1 202 ACCEPTED
Date: Sat, 27 Jun 2015 13:40:59 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 447
Content-Type: application/json
{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/49927a76-29cc-4af7-9fc6-ffc22dea11ab/", "task_id": "49927a76-29cc-4af7-9fc6-ffc22dea11ab"}], "result": {"notify_agent": true, "repo_id": "zoo_repo", "deleted": false, "_ns": "consumer_bindings", "distributor_id": "yum_distributor", "consumer_id": "maruska", "consumer_actions": [], "binding_config": {}, "_id": {"$oid": "558ea7e1e512ed777daefd80"}, "id": "558ea7e1e512ed777daefd80"}, "error": null}
and it's 400 for force:
>> pulp-consumer rpm bind --repo-id zoo_repo
Bind tasks successfully created:
Task Id: 72742f22-834e-441f-a469-4bf5360a3e6a
>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X DELETE -k -u admin:admin -d '{"force":"yes"}' "https://localhost/pulp/api/v2/consumers/maruska/bindings/zoo_repo/yum_distributor/"
HTTP/1.1 400 BAD REQUEST
Date: Sat, 27 Jun 2015 13:44:30 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 410
Connection: close
Content-Type: application/json
{"http_request_method": "DELETE", "exception": null, "error_message": "Invalid properties: ['force']", "property_names": ["force"], "_href": "/pulp/api/v2/consumers/maruska/bindings/zoo_repo/yum_distributor/", "http_status": 400, "error": {"code": "PLP0015", "data": {"property_names": ["force"], "properties": "['force']"}, "description": "Invalid properties: ['force']", "sub_errors": []}, "traceback": null}
Updated by igulina@redhat.com over 9 years ago
- Status changed from ASSIGNED to 6
An issue #1070 for invalid parameters has been created.
Updated by amacdona@redhat.com about 9 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE
Updated by bmbouter over 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.