proxmoxer
proxmoxer copied to clipboard
Add support for resources with dashes in name
Proxmox API includes a few resources with dashes (-) in their name (like /api2/json/nodes/{node}/qemu/{vmid}/agent/get-host-name). However the dash character (-) is not authorized in Python object attributes.
This PR adds support for this kind of resource's name by replacing dashes by underscores.
Exemple code :
client.nodes('my_node').qemu(12).agent.get_host_name.get()
will call the API URL : /api2/json/nodes/my_node/qemu/12/agent/get-host-name
Coverage increased (+0.07%) to 79.208% when pulling de51882cf5717195f0f42152ead471360fc708ce on julozi:support_dash_resources into f7874b53ebd7e06de1396b200d6a6020d696c984 on swayf:develop.
@julozi Would you mind re-creating this PR for https://github.com/proxmoxer/proxmoxer ?