<div dir="ltr"><div dir="ltr"><div>Actually, I can see where name and short is being squashed. In the Errata serializer;</div><div><br></div><div>            for collection_idx, collection in enumerate(collections):<br>                # To preserve the original format of a pkglist the 'short' and 'name'<br>                # keys are added. 'short' can be an empty string, collection 'name'<br>                # should be unique within an erratum.<br>                item = {'packages': collection['packages'][0],<br>                        'short': '',<br>                        'name': 'collection-%s' % collection_idx}</div><div><br></div><div>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.<br></div><div><br></div><div>Cheers,</div><div>Grant<br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 23 May 2019 at 15:37, Grant Byers <<a href="mailto:grant.byers@gmail.com">grant.byers@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>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;</div><div><br></div><div>    metadata = {<br>       ...<br>        'pkglist': [{<br>            'name': repo.get('display_name'),<br>            'short': repo.get('id'),<br>            'packages': packages,<br>        }],<br>        ...<br>    }</div><div><br></div><div>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).</div><div><br></div><div>However, when I use the /content/units/erratum/search/ REST endpoint to retrieve the errata, I get the following;</div><div><br></div><div>...<br></div><div>  "pkglist": [<br>    {<br>      "packages": [<br>...<br>      ],<br>      "name": "collection-0",<br>      "short": ""<br>    }<br>  ],</div><div><br></div><div>Shouldn't I be able to set these?</div><div><br></div><div>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.<br></div><div><br></div><div>Any ideas on either of these issues? <br></div><div><br></div><div>Thanks,</div><div>Grant</div><div><br></div></div>
</blockquote></div>