Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates pulp-smash for repo layout changes #1174

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions pulp_smash/pulp3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ def inner(repo, version_href=None):
repo_version = client.get(version_href)

content = defaultdict(list)
for content_type, content_url in repo_version[content_field].items():
typed_content = client.get(content_url)
for content_type, content_dict in repo_version['content_summary'][content_field].items():
typed_content = client.get(content_dict['href'])
content[content_type] = typed_content
return content
return inner


get_content = _build_content_fetcher('content_hrefs') # pylint:disable=invalid-name
get_added_content = _build_content_fetcher('content_added_hrefs') # pylint:disable=invalid-name
get_removed_content = _build_content_fetcher('content_removed_hrefs') # pylint:disable=invalid-name
bmbouter marked this conversation as resolved.
Show resolved Hide resolved
get_content = _build_content_fetcher('present') # pylint:disable=invalid-name
get_added_content = _build_content_fetcher('added') # pylint:disable=invalid-name
get_removed_content = _build_content_fetcher('removed') # pylint:disable=invalid-name


def _build_summary_fetcher(summary_field):
Expand Down Expand Up @@ -196,13 +196,17 @@ def inner(repo, version_href=None):
return {}

client = api.Client(config.get_config(), api.page_handler)
return client.get(version_href)[summary_field]
to_return = client.get(version_href)['content_summary'][summary_field]
for key in to_return:
# provide the old interface pre-changes from https://github.com/pulp/pulpcore/pull/2
to_return[key] = to_return[key]['count']
return to_return
return inner


get_content_summary = _build_summary_fetcher('content_summary') # pylint:disable=invalid-name
get_added_content_summary = _build_summary_fetcher('content_added_summary') # pylint:disable=invalid-name
get_removed_content_summary = _build_summary_fetcher('content_removed_summary') # pylint:disable=invalid-name
get_content_summary = _build_summary_fetcher('present') # pylint:disable=invalid-name
get_added_content_summary = _build_summary_fetcher('added') # pylint:disable=invalid-name
get_removed_content_summary = _build_summary_fetcher('removed') # pylint:disable=invalid-name


def delete_orphans(cfg=None):
Expand Down