Skip to content

Commit

Permalink
Merge pull request pulp#3980 from goosemania/pmoravec-6334
Browse files Browse the repository at this point in the history
Query only specified set of fields
  • Loading branch information
goosemania authored Mar 17, 2020
2 parents 27c8b59 + 32763d4 commit 75ccc04
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/pulp/plugins/conduits/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def get_bindings(self, consumer_id):
bindings = manager.find_by_consumer(consumer_id)
return [b['repo_id'] for b in bindings]

def get_repo_units(self, repo_id, content_type_id, additional_unit_fields=None):
def get_repo_units(self, repo_id, content_type_id, additional_unit_fields=None,
only_unit_fields=None):
"""
Searches for units in the given repository with given content type
and returns a plugin unit containing unit id, unit key and any additional
Expand All @@ -55,7 +56,10 @@ def get_repo_units(self, repo_id, content_type_id, additional_unit_fields=None):
"""
additional_unit_fields = additional_unit_fields or []
try:
unit_key_fields = units_controller.get_unit_key_fields_for_type(content_type_id)
if only_unit_fields is None:
unit_key_fields = units_controller.get_unit_key_fields_for_type(content_type_id)
else:
unit_key_fields = only_unit_fields
serializer = units_controller.get_model_serializer_for_type(content_type_id)

# Query repo association manager to get all units of given type
Expand Down

0 comments on commit 75ccc04

Please sign in to comment.