swayf / proxmoxer

python wrapper for Proxmox API v2 (https://pve.proxmox.com/pve-docs/api-viewer/index.html)
MIT License
156 stars 58 forks source link

Proxmox api change? #57

Open ibr opened 6 years ago

ibr commented 6 years ago

After updating proxmox to 5.2-8 all of my proxmoxer-python scripts are not working anymore:
Example with python3 2018-09-13 10:46:12,698 INFO:proxmoxer.core: GET /nodes/moritz/storage/backup/content 2018-09-13 10:46:12,699 DEBUG:paramiko.transport: [chan 0] Max packet in: 32768 bytes 2018-09-13 10:46:14,363 DEBUG:proxmoxer.core: Status code: 500, output: ┌─────────┬────────────┬───────────────────────────────────────────────────────────────────────────────────────────┬────────┬──────┬──────┐ │ format │ size │ volid │ parent │ used │ vmid │ ├─────────┼────────────┼───────────────────────────────────────────────────────────────────────────────────────────┼────────┼──────┼──────┤ the same with pyton2 2018-09-13 11:25:06,789 INFO:proxmoxer.core: GET /nodes/moritz/storage/backup/content 2018-09-13 11:25:06,789 DEBUG:paramiko.transport: [chan 0] Max packet in: 32768 bytes ... 2018-09-13 11:25:08,309 DEBUG:paramiko.transport: [chan 0] EOF received (0) Traceback (most recent call last): File "/usr/local/bin/vm_kontrolle_backup.py", line 17, in <module> backup = node.storage('backup').content.get() File "/usr/local/lib/python2.7/dist-packages/proxmoxer/core.py", line 84, in get return self(args)._request("GET", params=params) File "/usr/local/lib/python2.7/dist-packages/proxmoxer/core.py", line 74, in _request resp = self._store["session"].request(method, url, data=data or None, params=params) File "/usr/local/lib/python2.7/dist-packages/proxmoxer/backends/base_ssh.py", line 46, in request stdout, stderr = self._exec(full_cmd) File "/usr/local/lib/python2.7/dist-packages/proxmoxer/backends/ssh_paramiko.py", line 59, in _exec stdout = session.makefile('rb', -1).read().decode() 2018-09-13 11:25:08,310 DEBUG:paramiko.transport: [chan 0] EOF sent (0) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128) I've also tried older versions of proxmoxer

gustavovalverde commented 5 years ago

Having the same issue using paramiko as backend. Were you able to workaround this one @ibr?

gustavovalverde commented 5 years ago

I could fix this with https://github.com/iterativo-git/proxmoxer/pull/1/files from @mihailstoynov

ibr commented 5 years ago

Yes, this works for me too.