[pve-devel] [RFC/PATCH pve-common 4/5] pbs client: deprecate namespaced parameters

Fabian Ebner f.ebner at proxmox.com
Wed Jul 20 12:59:44 CEST 2022


All existing callers for functions with namespaced parameters just
re-use the one that's passed in via the initial configuration already,
so there is no need for namespaced parameters currently.

If the need for one PBS client to handle multiple namespaces arises, a
set_namespace() function could be added, or the relevant functions
could take an additional parameter, either for just the namespace or
like $cmd_opts in restore_pxar().

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/PVE/PBSClient.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm
index dfb8d76..34d3f67 100644
--- a/src/PVE/PBSClient.pm
+++ b/src/PVE/PBSClient.pm
@@ -242,6 +242,8 @@ sub autogen_encryption_key {
     return file_get_contents($encfile);
 };
 
+# TODO remove support for namespaced parameters. Needs Breaks for pmg-api and libpve-storage-perl.
+# Deprecated! The namespace should be passed in as part of the config in new().
 # Snapshot or group parameters can be either just a string and will then default to the namespace
 # that's part of the initial configuration in new(), or a tuple of `[namespace, snapshot]`.
 my sub split_namespaced_parameter : prototype($$) {
-- 
2.30.2






More information about the pve-devel mailing list