mirror of
https://github.com/proxmoxer/proxmoxer.git
synced 2026-04-25 07:06:00 +03:00
[GH-ISSUE #104] proper checksum-algorithm value passing in the request #55
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#55
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 @NlVlN on GitHub (Jul 15, 2022).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/104
Originally assigned to: @jhollowe on GitHub.
Documentation (https://proxmoxer.github.io/docs/1.2/examples/files/#downloading-files-to-pve) says that it is possible to verify the checksum by providing the checksum and the checksum-algorithm like in the example:
proxmox.nodes("<node_name>").storage("<storage_name>")("download-url").post(url=sourceURL, content="<content_type>", filename="<file_name.extension>", checksum="<hash>", "checksum-algorithm": "<md5 | sha1 | sha224 | sha256 | sha384 | sha512>")However running the following example;
proxmox.nodes("proxmox").storage("local")("download-url").post(url=iso_url, content="iso", filename=image_name, checksum=sha256sum, "checksum-algorithm": "sha256")produces "SyntaxError: positional argument follows keyword argument" error near
checksum-algorithmparameter.Is there another method to pass the checksum algorithm to the request, for example, through the variable 'params' or 'data'? I've tried quite a few options and none of them work.
@jhollowe commented on GitHub (Aug 4, 2022):
I know I ran into this when I was testing the downloader, but I forget how I got around it. I'm planning on adding a file upload/download tools module to version 2.0, but haven't got around to that yet.
I think you can create a dict of the arguments you want to pass in and then unpack those into the
postfunction call.e.g. (untested code)
Let me know if that works.
@jhollowe commented on GitHub (Sep 18, 2022):
Did the above suggestion work for you?
@NlVlN commented on GitHub (Oct 30, 2022):
Thanks! Works like a charm.
The only think I had to do was to change the first dict key to lowercase (‘URL’ to ‘url’).