[PR #45] [MERGED] allow passing values containg spaces and special characters when using ssh #150

Closed
opened 2026-02-27 15:46:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/proxmoxer/proxmoxer/pull/45
Author: @mihailstoynov
Created: 1/29/2021
Status: Merged
Merged: 1/30/2021
Merged by: @jhollowe

Base: developHead: quote-values-in-proxmoxbasesshsession


📝 Commits (2)

  • 1443afc allow passing values containg spaces and special characters when using ssh
  • 427883f tests fixed on quoted parameter values

📊 Changes

2 files changed (+29 additions, -29 deletions)

View changed files

📝 proxmoxer/backends/base_ssh.py (+1 -1)
📝 tests/base/base_ssh_suite.py (+28 -28)

📄 Description

If you use ssh to connect to proxmox and want to change the password for a user and the new password is password with space, you do:

# pvesh set /access/password --password 'password with space' --userid 'user@pve'

you have to surround the password with single quotes, otherwise the command fails. When using proxmoxer it fails with an obscure 400 error:

INFO:proxmoxer.core:PUT /access/password {'password': 'password with space', 'userid': 'user@pve'}
Traceback (most recent call last):
  File "/site-packages/prxapi/proxmox.py", line 250, in retry_request_proxy
    return request_orig(*args, **kwargs)
  File "/site-packages/proxmoxer/core.py", line 96, in _request
    raise ResourceException("{0} {1}: {2}".format(
proxmoxer.core.ResourceException: 400 Bad Request: 400 too many arguments
pvesh set <api_path> --password <string> --userid <string> [OPTIONS] [FORMAT_OPTIONS]

The solution is to quote the value.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/proxmoxer/proxmoxer/pull/45 **Author:** [@mihailstoynov](https://github.com/mihailstoynov) **Created:** 1/29/2021 **Status:** ✅ Merged **Merged:** 1/30/2021 **Merged by:** [@jhollowe](https://github.com/jhollowe) **Base:** `develop` ← **Head:** `quote-values-in-proxmoxbasesshsession` --- ### 📝 Commits (2) - [`1443afc`](https://github.com/proxmoxer/proxmoxer/commit/1443afc62cdba4115cddf21dff1670214d08437f) allow passing values containg spaces and special characters when using ssh - [`427883f`](https://github.com/proxmoxer/proxmoxer/commit/427883f5f4bda79d7a6b57fdaaa0d25c8c80b6a6) tests fixed on quoted parameter values ### 📊 Changes **2 files changed** (+29 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `proxmoxer/backends/base_ssh.py` (+1 -1) 📝 `tests/base/base_ssh_suite.py` (+28 -28) </details> ### 📄 Description If you use ssh to connect to proxmox and want to change the password for a user and the new password is `password with space`, you do: `# pvesh set /access/password --password 'password with space' --userid 'user@pve'` you have to surround the password with single quotes, otherwise the command fails. When using proxmoxer it fails with an obscure 400 error: ``` INFO:proxmoxer.core:PUT /access/password {'password': 'password with space', 'userid': 'user@pve'} Traceback (most recent call last): File "/site-packages/prxapi/proxmox.py", line 250, in retry_request_proxy return request_orig(*args, **kwargs) File "/site-packages/proxmoxer/core.py", line 96, in _request raise ResourceException("{0} {1}: {2}".format( proxmoxer.core.ResourceException: 400 Bad Request: 400 too many arguments pvesh set <api_path> --password <string> --userid <string> [OPTIONS] [FORMAT_OPTIONS] ``` The solution is to quote the value. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 15:46:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmoxer#150
No description provided.