But keep old one for compatibility.

Signed-off-by: Dietmar Maurer <diet...@proxmox.com>
---
 src/PVE/CLIHandler.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
index 5e2d3b8..1fd7b02 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -118,7 +118,8 @@ sub generate_usage_str {
     $indent //= '';
 
     my $read_password_func = $cli_handler_class->can('read_password');
-    my $param_mapping_func = 
$cli_handler_class->can('string_param_file_mapping');
+    my $param_mapping_func = $cli_handler_class->can('param_mapping') ||
+       $cli_handler_class->can('string_param_file_mapping');
 
     my ($subcmd, $def) = resolve_cmd($cmd);
 
@@ -546,7 +547,8 @@ sub run_cli_handler {
     my $preparefunc = $params{prepare};
 
     my $read_password_func = $class->can('read_password');
-    my $param_mapping_func = $class->can('string_param_file_mapping');
+    my $param_mapping_func = $cli_handler_class->can('param_mapping') ||
+       $class->can('string_param_file_mapping');
 
     $exename = &$get_exe_name($class);
 
-- 
2.11.0

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to