diff --git a/pubtools/pulplib/_impl/client/client.py b/pubtools/pulplib/_impl/client/client.py index a963304d..b5ce9244 100644 --- a/pubtools/pulplib/_impl/client/client.py +++ b/pubtools/pulplib/_impl/client/client.py @@ -203,11 +203,11 @@ def search_repository(self, criteria=None): Repository, "repositories", criteria=criteria, search_options=search_options ) - def search_repository_content(self, repository_id, type_ids, criteria=None): + def search_repository_content(self, repo_id, type_ids, criteria=None): """Search the given repository for content matching the given criteria. Args: - repository_id (str) + repo_id (str) The ID of the repository to search. type_ids (str, list, tuple) A list of content types to search. @@ -225,7 +225,7 @@ def search_repository_content(self, repository_id, type_ids, criteria=None): .. versionadded:: 2.4.0 """ - resource_type = "repositories/%s" % repository_id + resource_type = "repositories/%s" % repo_id search_options = {"type_ids": validate_type_ids(type_ids)} return list( self._search( diff --git a/pubtools/pulplib/_impl/fake/client.py b/pubtools/pulplib/_impl/fake/client.py index fa09a2c2..2b0712d5 100644 --- a/pubtools/pulplib/_impl/fake/client.py +++ b/pubtools/pulplib/_impl/fake/client.py @@ -91,14 +91,14 @@ def search_repository(self, criteria=None): random.shuffle(repos) return self._prepare_pages(repos) - def search_repository_content(self, repository_id, type_ids, criteria=None): + def search_repository_content(self, repo_id, type_ids, criteria=None): criteria = criteria or Criteria.true() units = [] filters_for_criteria(criteria, Unit) try: - for unit in self._repo_units[repository_id]: + for unit in self._repo_units[repo_id]: if unit.content_type_id in validate_type_ids(type_ids) and match_object( criteria, unit ): diff --git a/pubtools/pulplib/_impl/model/unit/modulemd_defaults.py b/pubtools/pulplib/_impl/model/unit/modulemd_defaults.py index 2d109ee8..912750f0 100644 --- a/pubtools/pulplib/_impl/model/unit/modulemd_defaults.py +++ b/pubtools/pulplib/_impl/model/unit/modulemd_defaults.py @@ -18,7 +18,7 @@ class ModulemdDefaultsUnit(Unit): stream = pulp_attrib(type=str, pulp_field="stream") """The stream of this modulemd defaults unit""" - repository_id = pulp_attrib(type=str, pulp_field="repo_id") + repo_id = pulp_attrib(type=str, pulp_field="repo_id") """The repository ID bound to this modulemd defaults unit""" profiles = pulp_attrib(pulp_field="profiles") diff --git a/tests/client/test_client.py b/tests/client/test_client.py index 712b1732..36b18980 100644 --- a/tests/client/test_client.py +++ b/tests/client/test_client.py @@ -82,7 +82,7 @@ def test_can_search_repository_content(client, requests_mocker): ModulemdDefaultsUnit( content_type_id="modulemd_defaults", name="mdd", - repository_id="mdd-repo", + repo_id="mdd-repo", stream="1.0", profiles={"p1": ["something"]}, )