Hi Grant, You are right, collection full/short names are not preserved and it's done to be sure that collection names are unique. I don't think the names are stored in the DB that way, I think it's only serialization which modifies those names to make them unique for the publication (in updateinfo.xml) or for search results. The reason is that id of erratum is unique only within a repo, so multiple repos can contain erratum with the same id. When one copies all those errata with the same id into a repo, their pkglists merge and collection names have to be unique, otherwise yum/dnf doesn't handle it well. We probably could have preserved the short name though but the full name has to be unique.
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. > Just to be clear, you mean that pkglist is empty? (and not that rpms themselves are not in a repo). If so, could you please file an issue and add steps to reproduce. If you can include all the commands/API calls you are making, including erratum info you are trying to import, that would be very helpful. Issue tracker for RPM plugin: https://pulp.plan.io/projects/pulp_rpm/issues/new Thank you, Tanya On Thu, May 23, 2019 at 8:16 AM Grant Byers <[email protected]> wrote: > 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 <[email protected]> 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 >> >> _______________________________________________ > Pulp-list mailing list > [email protected] > https://www.redhat.com/mailman/listinfo/pulp-list
_______________________________________________ Pulp-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/pulp-list
