Project

Profile

Help

Issue #1535

closed

Errata unassociate not working

Added by paji@redhat.com almost 9 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Master
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

1) Get the zoo5 repo from -> https://github.com/Katello/runcible/tree/master/test/fixtures/repositories/zoo5 (we just need the repo.) Steps below will assume file:///var/www/repositories/zoo5 is the destination
2)

$ pulp-admin rpm repo create --repo-id=ideate --feed=file:///var/www/repositories/zoo5
$ pulp-admin rpm repo sync run --repo-id=ideate
$ pulp-admin rpm repo content errata --repo-id=ideate

...
Id:          RHEA-2010:0001
..
Id:          RHEA-2010:0002
......

$ pulp-admin -vv rpm repo remove errata --repo-id=ideate --in='id=RHEA-2010:0002'
....
INFO - POST request to /pulp/api/v2/repositories/ideate/actions/unassociate/ with parameters {"criteria": {"type_ids": ["erratum"], "filters": {"unit": {"id": {"$in": ["RHEA-2010:0002"]}}}}}
....
Running...

Nothing found that matches the given criteria.

Related issues

Related to Pulp - Issue #1534: Errata search not workingCLOSED - CURRENTRELEASEsemyersActions
Copied from Pulp - Issue #1533: package group/category unassociate not workingCLOSED - CURRENTRELEASEsemyersActions
Actions #1

Updated by paji@redhat.com almost 9 years ago

  • Copied from Issue #1533: package group/category unassociate not working added
Actions #2

Updated by mhrivnak almost 9 years ago

  • Priority changed from Normal to High
  • Severity changed from 2. Medium to 3. High
  • Platform Release set to 2.8.0
  • Triaged changed from No to Yes
Actions #3

Updated by mhrivnak almost 9 years ago

  • Related to Issue #1534: Errata search not working added

Added by semyers almost 9 years ago

Revision 8d462ca8 | View on GitHub

unit association query uses model serializers

When building mongo queries, UnitAssociationQuery wasn't translating the incoming fields to their proper mongo fields via the model serializer.

To start, this change makes "public" the serializer translate methods that provide useful functionality when incoming criteria get broken down into their actual mongo queries.

Then, those public methods are used by UnitAssociationQuery to translate model fields before building queries to mongo.

https://pulp.plan.io/issues/1527 fixes #1527

https://pulp.plan.io/issues/1533 re #1533

https://pulp.plan.io/issues/1534 fixes #1534

https://pulp.plan.io/issues/1535 re #1535

Added by semyers almost 9 years ago

Revision 8d462ca8 | View on GitHub

unit association query uses model serializers

When building mongo queries, UnitAssociationQuery wasn't translating the incoming fields to their proper mongo fields via the model serializer.

To start, this change makes "public" the serializer translate methods that provide useful functionality when incoming criteria get broken down into their actual mongo queries.

Then, those public methods are used by UnitAssociationQuery to translate model fields before building queries to mongo.

https://pulp.plan.io/issues/1527 fixes #1527

https://pulp.plan.io/issues/1533 re #1533

https://pulp.plan.io/issues/1534 fixes #1534

https://pulp.plan.io/issues/1535 re #1535

Actions #4

Updated by semyers almost 9 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to semyers

After applying the fix from #1527, the errata is correctly unassociated as expected, but pulp-admin still reports that nothing matched the criteria. This is the same problem that #1533 encountered (comment 7).

Added by semyers almost 9 years ago

Revision 6c9751fa | View on GitHub

Use model serializers when searching mongoengine content units

When breaking a criteria down into its raw mongo queries, use the model serializers for a given content type to adjust the unit search spec as-needed for each content type in the criteria.

https://pulp.plan.io/issues/1479 fixes #1479

https://pulp.plan.io/issues/1533 fixes #1533

https://pulp.plan.io/issues/1535 fixes #1535

https://pulp.plan.io/issues/1563 fixes #1563

Added by semyers almost 9 years ago

Revision 6c9751fa | View on GitHub

Use model serializers when searching mongoengine content units

When breaking a criteria down into its raw mongo queries, use the model serializers for a given content type to adjust the unit search spec as-needed for each content type in the criteria.

https://pulp.plan.io/issues/1479 fixes #1479

https://pulp.plan.io/issues/1533 fixes #1533

https://pulp.plan.io/issues/1535 fixes #1535

https://pulp.plan.io/issues/1563 fixes #1563

Actions #5

Updated by semyers almost 9 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 0 to 100
Actions #6

Updated by dkliban@redhat.com over 8 years ago

  • Status changed from MODIFIED to 5
Actions #7

Updated by placko over 8 years ago

  • Status changed from 5 to 6
$ pulp-admin rpm repo create --repo-id=ideate --feed=file:///var/www/repositories/zoo5
Successfully created repository [ideate]

$ pulp-admin rpm repo sync run --repo-id=ideate
+----------------------------------------------------------------------+
                   Synchronizing Repository [ideate]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[-]
==================================== Snip =====================================
===============================================================================

Task Succeeded

[root@ip-10-15-2-47 ~]# pulp-admin rpm repo content errata --repo-id=ideate
Description: Empty errata
Id:          RHEA-2010:0001
Severity:
Summary:
Title:       Empty errata
Type:        security

Description: One package errata
Id:          RHEA-2010:0002
Severity:
Summary:
Title:       One package errata
Type:        security

[root@ip-10-15-2-47 ~]# pulp-admin -vv rpm repo remove errata --repo-id=ideate --in='id=RHEA-2010:0002'
2016-03-03 05:50:40,446 - DEBUG - sending POST request to /pulp/api/v2/repositories/ideate/actions/unassociate/
2016-03-03 05:50:40,575 - INFO - POST request to /pulp/api/v2/repositories/ideate/actions/unassociate/ with parameters {"criteria": {"type_ids": ["erratum"], "filters": {"unit": {"id": {"$in": ["RHEA-2010:0002"]}}}}}
2016-03-03 05:50:40,575 - INFO - Response status : 202

2016-03-03 05:50:40,575 - INFO - Response body :
 {
  "spawned_tasks": [
    {
      "_href": "/pulp/api/v2/tasks/070593aa-969d-4107-bf0c-7e117f58fa35/",
      "task_id": "070593aa-969d-4107-bf0c-7e117f58fa35"
    }
  ],
  "result": null,
  "error": null
}

This command may be exited via ctrl+c without affecting the request.

[-]
Running...
2016-03-03 05:50:41,577 - DEBUG - sending GET request to /pulp/api/v2/tasks/070593aa-969d-4107-bf0c-7e117f58fa35/
2016-03-03 05:50:41,663 - INFO - GET request to /pulp/api/v2/tasks/070593aa-969d-4107-bf0c-7e117f58fa35/ with parameters None
2016-03-03 05:50:41,663 - INFO - Response status : 200

2016-03-03 05:50:41,664 - INFO - Response body :
 {
  "exception": null,
  "task_type": "pulp.server.managers.repo.unit_association.unassociate_by_criteria",
  "_href": "/pulp/api/v2/tasks/070593aa-969d-4107-bf0c-7e117f58fa35/",
  "task_id": "070593aa-969d-4107-bf0c-7e117f58fa35",
  "tags": [
    "pulp:repository:ideate",
    "pulp:action:unassociate"
  ],
  "finish_time": "2016-03-03T10:50:40Z",
  "_ns": "task_status",
  "start_time": "2016-03-03T10:50:40Z",
  "traceback": null,
  "spawned_tasks": [],
  "progress_report": {},
  "queue": "reserved_resource_worker-1@host.dq",
  "state": "finished",
  "worker_name": "reserved_resource_worker-1@host.internal",
  "result": {
    "units_successful": [
      {
        "unit_key": {
          "id": "RHEA-2010:0002"
        },
        "type_id": "erratum"
      }
    ]
  },
  "error": null,
  "_id": {
    "$oid": "56d81700cbba263a6aedbbbe"
  },
  "id": "56d81700cbba263a6aedbbbe"
[\]
Running...

Units Removed:
  RHEA-2010:0002

$ pulp-admin rpm repo content errata --repo-id=ideate
Description: Empty errata
Id:          RHEA-2010:0001
Severity:
Summary:
Title:       Empty errata
Type:        security
Actions #8

Updated by dkliban@redhat.com over 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #10

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF