From 2af8e346572f896bfe5aa1a13ec585778369648a Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Mar 25 2019 09:28:42 +0000 Subject: Fix compatibility with new Pulp version. In latest Pulp version deployed internally, it is no longer possible to ask for particular sub-fields using the `fields` argument in the query. Pulp now supports only fields which directly match to its database fields in `fields` argument. The fix is simple. Instead of asking for `notes.content_set`, Freshmaker now asks just for `notes`. We will get more data from Pulp than we need (all `notest`, not just `notest.content_set`), but this does not break anything. --- diff --git a/freshmaker/pulp.py b/freshmaker/pulp.py index 1d89b05..c111754 100644 --- a/freshmaker/pulp.py +++ b/freshmaker/pulp.py @@ -62,7 +62,7 @@ class Pulp(object): 'filters': { 'id': {'$in': repo_ids}, }, - 'fields': ['notes.content_set'], + 'fields': ['notes'], } } repos = self._rest_post('repositories/search/', json.dumps(query_data)) diff --git a/tests/test_pulp.py b/tests/test_pulp.py index 205d911..cc62829 100644 --- a/tests/test_pulp.py +++ b/tests/test_pulp.py @@ -90,7 +90,7 @@ class TestPulp(helpers.FreshmakerTestCase): 'filters': { 'id': {'$in': repo_ids}, }, - 'fields': ['notes.content_set'], + 'fields': ['notes'], } }), auth=(self.username, self.password)) @@ -151,7 +151,7 @@ class TestPulp(helpers.FreshmakerTestCase): 'filters': { 'id': {'$in': repo_ids}, }, - 'fields': ['notes.content_set'], + 'fields': ['notes'], } }), auth=(self.username, self.password))