#375 Fix compatibility with new Pulp version.
Merged 5 years ago by jkaluza. Opened 5 years ago by jkaluza.
jkaluza/freshmaker pulp-notes  into  master

file modified
+1 -1
@@ -62,7 +62,7 @@ 

                  'filters': {

                      'id': {'$in': repo_ids},

                  },

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

+                 'fields': ['notes'],

              }

          }

          repos = self._rest_post('repositories/search/', json.dumps(query_data))

file modified
+2 -2
@@ -90,7 +90,7 @@ 

                      'filters': {

                          'id': {'$in': repo_ids},

                      },

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

+                     'fields': ['notes'],

                  }

              }),

              auth=(self.username, self.password))
@@ -151,7 +151,7 @@ 

                      'filters': {

                          'id': {'$in': repo_ids},

                      },

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

+                     'fields': ['notes'],

                  }

              }),

              auth=(self.username, self.password))

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 notes, not just notes.content_set), but this does not
break anything.

Pull-Request has been merged by jkaluza

5 years ago