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

Properly send in params in the Python API example #3406

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Oct 31, 2024

What changes are you introducing?

Python's requests library accepts a dict with params and then properly encodes this to be sent to a server. This avoids the need to manually encode this in our examples.

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

This fixes a build issue in Red Hat's downstream where Pantheon fails on &, but generally is safer and more understandable code.

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

This is an alternative to #3405.

I must admit I haven't tried this on a real system and is solely written based on knowing Python and requests.

Checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.12/Katello 4.14 (Satellite 6.16)
  • Foreman 3.11/Katello 4.13
  • Foreman 3.10/Katello 4.12
  • Foreman 3.9/Katello 4.11 (Satellite 6.15; orcharhino 6.8/6.9/6.10)
  • Foreman 3.8/Katello 4.10
  • Foreman 3.7/Katello 4.9 (Satellite 6.14)
  • Foreman 3.6/Katello 4.8
  • Foreman 3.5/Katello 4.7 (Satellite 6.13; orcharhino 6.6/6.7)
  • We do not accept PRs for Foreman older than 3.5.

Python's requests library accepts a dict with params and then properly
encodes this to be sent to a server. This avoids the need to manually
encode this in our examples.

This also fixes a build issue in Red Hat's downstream where Pantheon
fails on &.
@apinnick apinnick mentioned this pull request Oct 31, 2024
9 tasks
@maximiliankolb maximiliankolb marked this pull request as draft November 7, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant