Skip to content

Enhance the execution_output_by_id function#29

Open
jon-rtr wants to merge 6 commits intopschmitt:masterfrom
jon-rtr:add-options-to-get-output-2
Open

Enhance the execution_output_by_id function#29
jon-rtr wants to merge 6 commits intopschmitt:masterfrom
jon-rtr:add-options-to-get-output-2

Conversation

@jon-rtr
Copy link
Copy Markdown
Contributor

@jon-rtr jon-rtr commented Jan 23, 2020

There are some cases where end-users of the library want to override the
headers sent to Rundeck (ex. not every response is going to be
application/json).

Per https://docs.rundeck.com/docs/api/rundeck-api.html#execution-query,
we can pass a format parameter (json, xml, text) and specify the
relevant Accept header so that you can, for example, download the raw
log text.

Ignore JetBrains IDE-generated files.
Run the black formatter over the code.
As of 2020 Jan 01, official support for Python 2 has ended (https://www.python.org/doc/sunset-python-2/, https://python3statement.org/).

* Remove `from __future__ import absolute_import` statement.
* Remove `from __future__ import unicode_literals` statement.
* Remove `from __future__ import print_function` statement.
* Remove `from urlparse import urljoin` statement, and retain the Python
3 equivalent.
* Switch to using format strings.
* BUGFIX: Per https://docs.rundeck.com/docs/api/rundeck-api.html#bulk-delete-executions, the url in the bulk_delete_executions function should look like `{}/executions/delete`, not `{}/executions/{}/delete`.
From rundeck/rundeck#1923:
> I've traced the issue down to the Content-Type header that messes up the whole request (It's not needed for a GET anyway, was there from a previous POST). The output is still a XML, I'll open a different issue for that

There are a few posts saying the same thing: GET requests specifying a
Content-Type header causes the URL parameters to be ignored.
There are some cases where end-users of the library want to override the
headers sent to Rundeck (ex. not every response is going to be
application/json).
Per https://docs.rundeck.com/docs/api/rundeck-api.html#execution-query,
we can pass a format parameter (json, xml, text) and specify the
relevant Accept header so that you can, for example, download the raw
log text.
@jon-rtr jon-rtr requested a review from pschmitt January 23, 2020 02:52
@pschmitt pschmitt added the needs-rebase PR needs to be rebase against the current master label Apr 20, 2021
@tristanlatr
Copy link
Copy Markdown

Hi @jon-rtr,

Your pull request looks useful but all the formatting changes does not help merging this PR...

Open a new PR with only the execution_output_by_id() changes would be good I think.

@pschmitt
Copy link
Copy Markdown
Owner

Can you please rebase on the current master?

Copy link
Copy Markdown
Owner

@pschmitt pschmitt left a comment

Choose a reason for hiding this comment

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

Please rebase.

@tristanlatr
Copy link
Copy Markdown

I'll try to update these changes in a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase PR needs to be rebase against the current master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants