mirror of
https://github.com/proxmoxer/proxmoxer.git
synced 2026-04-25 07:06:00 +03:00
[GH-ISSUE #119] Implicitly remove None values from params #64
Labels
No labels
backend:https
backend:local
backend:openssh
backend:ssh_paramiko
pull-request
status:ansible-issue
status:help-wanted
status:info-needed
status:proxmox-issue
status:review-needed
type:bug 🐞
type:dependency ⛓️
type:docs 📝
type:enhancement ⏫
type:maintenance 🛠️
type:meta
type:question ❓
type:request ✋
type:testing 🧪
version:1.x
version:latest
version:py2
version:py3
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmoxer#64
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kristianheljas on GitHub (Nov 16, 2022).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/119
When calling proxmoxer API methods with
Nonevalues, it will behave differently when using https backend vs others.The difference comes from requests library, which will implicitly remove
Nonevalues from parameters.On other backends the
Nonevalues are implicitly converted to string, and providing them to the pvesh command.A stupid, but simple example of this would be:
Would you guys accept a PR removing
Nonevalues just as the requests module does?This issue surfaced from a ansible.community issue about implementing local backend.
@jhollowe commented on GitHub (Nov 18, 2022):
Sure, always willing to look at PRs! And standardizing usability between the different backends is definitely a goal.
@kristianheljas commented on GitHub (Nov 18, 2022):
Awsome!
Should same treatment applied to data as well?
I also discovered that tests utilizing
mock_resourcefixture do not actually check for data integrity. It's becauseMockSession.request()will always return statically defined{"data": {"key": "value"}}.Should I adjust the behaviour of
MockSession.request()as well?@jhollowe commented on GitHub (Nov 19, 2022):
Yeah, please improve as much as you want. The tests are just basic right now and could use improvement.
@kristianheljas commented on GitHub (Nov 19, 2022):
@jhollowe Awesome, PR is here: https://github.com/proxmoxer/proxmoxer/pull/120
Thanks!