[PR #109] [MERGED] Allow specifying resource_id as 0 for firewall rule compatibility #178

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

📋 Pull Request Information

Original PR: https://github.com/proxmoxer/proxmoxer/pull/109
Author: @johnbergvall
Created: 8/20/2022
Status: Merged
Merged: 8/25/2022
Merged by: @jhollowe

Base: developHead: patch-1


📝 Commits (1)

  • bca0a25 Allow specifying resource_id as 0 for firewall rule compatibility

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 proxmoxer/core.py (+1 -1)

📄 Description

E.g. proxmox.nodes(node_id).qemu(vm_id).firewall.rules(rule_pos) can use rule_pos = 0 which is treated as False (unset) and therefore as unset resource_id.

This change keeps treating empty strings as a non-specified id for backwards compatibility reasons, but checking if resource_id is None is probably more correct.

A workaround for earlier versions is to cast pos to a str(rule_pos) before calling .rules(rule_pos)


🔄 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/109 **Author:** [@johnbergvall](https://github.com/johnbergvall) **Created:** 8/20/2022 **Status:** ✅ Merged **Merged:** 8/25/2022 **Merged by:** [@jhollowe](https://github.com/jhollowe) **Base:** `develop` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`bca0a25`](https://github.com/proxmoxer/proxmoxer/commit/bca0a25873e3fa005ef6dff5b4382e26cedf6612) Allow specifying resource_id as 0 for firewall rule compatibility ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `proxmoxer/core.py` (+1 -1) </details> ### 📄 Description E.g. `proxmox.nodes(node_id).qemu(vm_id).firewall.rules(rule_pos)` can use `rule_pos = 0` which is treated as False (unset) and therefore as unset `resource_id`. This change keeps treating empty strings as a non-specified id for backwards compatibility reasons, but checking `if resource_id is None` is probably more correct. A workaround for earlier versions is to cast pos to a `str(rule_pos)` before calling `.rules(rule_pos)` --- <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:47 +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#178
No description provided.