Project

Profile

Help

Issue #2514

closed

Creating a group no longer updates the existing group

Added by mihai.ibanescu@gmail.com over 7 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Sprint/Milestone:
-
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.

Also available in: Atom PDF