-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add publication() #1194
Add publication() #1194
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,27 @@ def publish(cfg, publisher, repo, version_href=None): | |
return client.get(tasks[-1]["created_resources"][0]) | ||
|
||
|
||
def publication(cfg, path, repo, version_href=None, **kwargs): | ||
"""Create a publication. | ||
|
||
:param pulp_smash.config.PulpSmashConfig cfg: Information about the Pulp | ||
host. | ||
:param repo: A dict of information about the repository. | ||
:param version_href: The repository version to be published. | ||
:returns: A publication. A dict of information about the just created | ||
publication. | ||
""" | ||
|
||
if version_href is None: | ||
data = {"repository": repo["_href"]} | ||
else: | ||
data = {"repository_version": version_href} | ||
client = api.Client(cfg, api.json_handler) | ||
call_report = client.post(path, data) | ||
tasks = tuple(api.poll_spawned_tasks(cfg, call_report)) | ||
return client.get(tasks[-1]["created_resources"][0]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The The only difference right now is that it is reading |
||
|
||
|
||
def _build_content_fetcher(content_field): | ||
"""Build closure for fetching content from a repository. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides @rochacbruno comments.
path is not listed in the docstrings.
**kwargs not used in the code.