[Pulp-list] pulp 2 API upload example?
Jay Dobies
jason.dobies at redhat.com
Wed May 22 12:23:33 UTC 2013
On 05/21/2013 09:35 PM, Ryan Bowlby wrote:
> Hi All,
>
> I'm attempting to perform an upload and have succeeded in getting to
> step 3: the import_upload action.
>
> Can someone please describe what information is required in the
> unit_key object for the RPM content type? Merely directing me to the
> docs for this is likely sufficient.
>
> I have this:
>
> {
> "unit_type_id": "rpm",
> "upload_id": "3b2d1ad4-a29d-4b4b-b780-aa48b572150b",
> "unit_key": {"whatisrequiredhere?": "?" }
> }
>
> Also, why is the unit_key not optional?
This one is kinda tricky.
Back in v1, there was an issue in reading the RPM's metadata on the
server. I forget the specifics, but I believe it had something to do
with a RHEL5 server unable to read certain newer RPMs.
At the time, the solution was to have the client read the RPM metadata
under the assumption that if it was doing the upload, presumably it
could open up the RPM it was uploading.
That behavior has stuck around and is set to be reevaluated in the next
few months. I had wanted to address it in this yum importer rewrite, but
we just don't have the resources to dig into it.
So to upload an RPM, you have to look at the RPM headers client-side and
pass them to the server. The easiest thing to do it point you towards
the code in our client that does it:
pulp_rpm/src/pulp_rpm/extension/admin/upload/package.py
Like I said, we know this is far from ideal and are going to address it
in the next few months. It's even more annoying since I don't know the
exact reason it was done this way in the first place, but I'm pretty
sure my explanation was close.
>
> Thanks,
> Ryan
>
> _______________________________________________
> Pulp-list mailing list
> Pulp-list at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list
>
--
Jay Dobies
Freenode: jdob @ #pulp
http://pulpproject.org
More information about the Pulp-list
mailing list