Actions
Issue #2514
closedCreating a group no longer updates the existing group
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.10.3
Platform Release:
2.11.1
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
In pulp 2.7, if a group was uploaded (via the API's /import_upload/) and it already existed, it was updated.
In pulp 2.10, the update doesn't happen anymore.
The problem is in the yum importer, in _handle_group_category_comps:
else:
# uploading a package group, package category or package environment
unit_data = {}
unit_data.update(metadata or {})
unit_data.update(unit_key or {})
try:
unit = model_class(**unit_data)
except TypeError:
raise ModelInstantiationError()
try:
unit.save()
except NotUniqueError:
unit = unit.__class__.objects.filter(**unit.unit_key).first()
repo_controller.associate_single_unit(repo, unit)
Notice that, if the unit exists (and fails to save), the existing unit is never updated.
Actions
Update the group if one exists in the db.
closes #2514 https://pulp.plan.io/issues/2514