Issue #637
closedafter successful import via API, used upload_id is deleted automatically
Description
Description of problem:
it's said that "Once the uploaded file has been successfully imported and no further operations are desired, the caller should delete the upload request from the server."
However, the upload_id is deleted automatically after successful import.
It seems this bug is related to https://bugzilla.redhat.com/show_bug.cgi?id=1173176
Version-Release number of selected component (if applicable):
rpm -qa | grep pulp-server
pulp-server-2.6.0-0.1.alpha.el7.noarch
How reproducible:
always
curl -i -H "Accept: application/json" -X POST -k -u user:pass 'https://localhost/pulp/api/v2/content/uploads/'
HTTP/1.1 201 Created
Date: Thu, 11 Dec 2014 15:59:29 GMT
Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: /pulp/api/v2/content/uploads/fc00048f-11b7-491a-8215-fb7bb4723930/
Content-Length: 132
Content-Type: application/json
{"upload_id": "fc00048f-11b7-491a-8215-fb7bb4723930", "_href": "/pulp/api/v2/content/uploads/fc00048f-11b7-491a-8215-fb7bb4723930/"}
curl -k -X GET https://user:pass@localhost/pulp/api/v2/content/uploads/
{"upload_ids": ["fc00048f-11b7-491a-8215-fb7bb4723930"]}
curl -i -H "Accept: application/json" -X PUT -k 'https://user:pass@localhost/pulp/api/v2/content/uploads/fc00048f-11b7-491a-8215-fb7bb4723930/0/' --data-binary '@bear-4.1-1.noarch.rpm'
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Thu, 11 Dec 2014 16:05:42 GMT
Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 4
Content-Type: application/json
null
curl -k -X GET https://admin:admin@localhost/pulp/api/v2/content/uploads/
{"upload_ids": ["fc00048f-11b7-491a-8215-fb7bb4723930"]}
curl -i -H "Accept: application/json" -X POST -k -u user:pass 'https://localhost/pulp/api/v2/repositories/makaka/actions/import_upload/' -d '{"override_config": {}, "unit_type_id": "rpm", "upload_id": "fc00048f-11b7-491a-8215-fb7bb4723930", "unit_key": {}, "unit_metadata": {"checksum_type": null}}'
HTTP/1.1 202 Accepted
Date: Thu, 11 Dec 2014 16:07:12 GMT
Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 172
Content-Type: application/json
{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/b471f343-cf6d-4124-8683-f6c997f6ea7d/", "task_id": "b471f343-cf6d-4124-8683-f6c997f6ea7d"}], "result": null, "error": null}
curl -k -X GET https://user:pass@localhost/pulp/api/v2/content/uploads/
{"upload_ids": []}
curl -k -X GET https://admin:admin@localhost/pulp/api/v2/tasks/b471f343-cf6d-4124-8683-f6c997f6ea7d/ | python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 791 100 791 0 0 1731 0 --:--:-- --:--:-- --:--:-- 1734
{
"_href": "/pulp/api/v2/tasks/b471f343-cf6d-4124-8683-f6c997f6ea7d/",
"_id": {
"$oid": "5489c13052f8ef2e87d82b9d"
},
"_ns": "task_status",
"error": null,
"exception": null,
"finish_time": "2014-12-11T16:07:13Z",
"id": "5489c1311e0a5959e1810b09",
"progress_report": {},
"queue": "reserved_resource_worker-0@host",
"result": {
"details": {},
"success_flag": true,
"summary": ""
},
"spawned_tasks": [],
"start_time": "2014-12-11T16:07:13Z",
"state": "finished",
"tags": [
"pulp:repository:makaka",
"pulp:action:import_upload"
],
"task_id": "b471f343-cf6d-4124-8683-f6c997f6ea7d",
"task_type": "pulp.server.managers.content.upload.import_uploaded_unit",
"traceback": null,
"worker_name": "reserved_resource_worker-0@host"
}
+ This bug was cloned from Bugzilla Bug #1173199 +