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

Add publication() #1194

Closed
wants to merge 1 commit into from
Closed

Add publication() #1194

wants to merge 1 commit into from

Conversation

ipanova
Copy link
Member

@ipanova ipanova commented Apr 2, 2019

No description provided.

ipanova added a commit to ipanova/pulp_docker that referenced this pull request Apr 2, 2019
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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task_handler already does this for generic task based resource creation
https://github.com/PulpQE/pulp-smash/blob/master/pulp_smash/api.py#L205-L268

The only difference right now is that it is reading tasks[0] assuming it has only one, we can change to read tasks[-1] or make it a parameter.

@@ -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):
Copy link

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.

@nixocio
Copy link

nixocio commented Apr 3, 2019

@ipanova , can we add a simple commit message? If there is a related issue even better. Just to be consistent with what we have been doing.

ipanova added a commit to ipanova/pulp_docker that referenced this pull request Apr 3, 2019
@ipanova
Copy link
Member Author

ipanova commented Apr 3, 2019

based on the comments i am closing the pr and going to use task_hander.

@ipanova ipanova closed this Apr 3, 2019
ipanova added a commit to ipanova/pulp_docker that referenced this pull request Apr 3, 2019
ipanova added a commit to ipanova/pulp_docker that referenced this pull request Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants