Skip to content

Commit

Permalink
Rename repository_id variable to repo_id
Browse files Browse the repository at this point in the history
  • Loading branch information
negillett committed Dec 5, 2019
1 parent d354e58 commit 69d5d4e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pubtools/pulplib/_impl/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions pubtools/pulplib/_impl/fake/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down
2 changes: 1 addition & 1 deletion pubtools/pulplib/_impl/model/unit/modulemd_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tests/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]},
)
Expand Down

0 comments on commit 69d5d4e

Please sign in to comment.