#265 Fix compatibility with new Pulp version.
Merged 3 months ago by jkaluza. Opened 3 months ago by jkaluza.
jkaluza/odcs pulp-notes  into  master

file modified
+1 -2

@@ -155,8 +155,7 @@ 

                  'filters': {

                      'notes.content_set': {'$in': content_sets},

                  },

-                 'fields': ['notes.relative_url', 'notes.content_set',

-                            'notes.arch', 'notes.signatures'],

+                 'fields': ['notes'],

              }

          }

  

file modified
+3 -6

@@ -487,8 +487,7 @@ 

  

          expected_query = {

              "criteria": {

-                 "fields": ["notes.relative_url", "notes.content_set",

-                            "notes.arch", "notes.signatures"],

+                 "fields": ["notes"],

                  "filters": {

                      "notes.content_set": {"$in": ["foo-1", "foo-2", "foo-3"]},

                      "notes.include_in_download_service": "True"

@@ -554,8 +553,7 @@ 

  

          expected_query = {

              "criteria": {

-                 "fields": ["notes.relative_url", "notes.content_set",

-                            "notes.arch", "notes.signatures"],

+                 "fields": ["notes"],

                  "filters": {

                      "notes.content_set": {"$in": ["foo-1", "foo-2"]},

                  }

@@ -591,8 +589,7 @@ 

  

          expected_query = {

              "criteria": {

-                 "fields": ["notes.relative_url", "notes.content_set",

-                            "notes.arch", "notes.signatures"],

+                 "fields": ["notes"],

                  "filters": {

                      "notes.content_set": {"$in": ["foo-1", "foo-2"]},

                      "notes.include_in_download_service": "True"

file modified
+2 -4

@@ -45,8 +45,7 @@ 

          pulp_rest_post.assert_called_once_with(

              'repositories/search/',

              {'criteria': {

-                 'fields': ['notes.relative_url', 'notes.content_set',

-                            'notes.arch', 'notes.signatures'],

+                 'fields': ['notes'],

                  'filters': {

                      'notes.include_in_download_service': 'True',

                      'notes.content_set': {'$in': ['foo-1', 'foo-2']}

@@ -65,8 +64,7 @@ 

          pulp_rest_post.assert_called_once_with(

              'repositories/search/',

              {'criteria': {

-                 'fields': ['notes.relative_url', 'notes.content_set',

-                            'notes.arch', 'notes.signatures'],

+                 'fields': ['notes'],

                  'filters': {

                      'notes.content_set': {'$in': ['foo-1', 'foo-2']}

                  }

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, ODCS
now asks just for notes. We will get more data from Pulp than we
need (all notes, not just notes.content_set), but this does not
break anything.

Pull-Request has been merged by jkaluza

3 months ago