[Pulp-list] name & short fields for erratum pkglist

Grant Byers grant.byers at gmail.com
Thu May 23 06:15:30 UTC 2019


Actually, I can see where name and short is being squashed. In the Errata
serializer;

            for collection_idx, collection in enumerate(collections):
                # To preserve the original format of a pkglist the 'short'
and 'name'
                # keys are added. 'short' can be an empty string,
collection 'name'
                # should be unique within an erratum.
                item = {'packages': collection['packages'][0],
                        'short': '',
                        'name': 'collection-%s' % collection_idx}

But that doesn't explain why pkglist from additional repos doesn't persist.
If I import an errata into a 2nd repo, i'd expect any pkglist items to
persist.

Cheers,
Grant



On Thu, 23 May 2019 at 15:37, Grant Byers <grant.byers at gmail.com> wrote:

> Hi all,
>
> I'm running into a problem when importing multi-release erratum (Pulp
> 2.19.0) via the REST API. It seems regardless of what I set name & short
> fields to, they always end up set to name="collection-0", short="". For
> example;
>
>     metadata = {
>        ...
>         'pkglist': [{
>             'name': repo.get('display_name'),
>             'short': repo.get('id'),
>             'packages': packages,
>         }],
>         ...
>     }
>
> where packages is a list of package metadata (name, version, release,
> epoch, etc.), pkglist name in this instance is "CentOS-6 - Updates
> (x86_64)" and short=centos6-x86_64-updates (both fields of the repository
> I'm importing to).
>
> However, when I use the /content/units/erratum/search/ REST endpoint to
> retrieve the errata, I get the following;
>
> ...
>   "pkglist": [
>     {
>       "packages": [
> ...
>       ],
>       "name": "collection-0",
>       "short": ""
>     }
>   ],
>
> Shouldn't I be able to set these?
>
> If I try to import the same errata into a different repository with its
> respective packages included in pkglist, those packages don't appear to
> make it in. Looking at the model for ErratumPkglist, the unique key is a
> composition of both errata_id and repo_id, so it probably doesn't matter
> what I set the name and short fields too, but it would be useful regardless.
>
> Any ideas on either of these issues?
>
> Thanks,
> Grant
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20190523/36fdb646/attachment.htm>


More information about the Pulp-list mailing list