[pve-devel] [PATCH common 1/2] add schema definition as return to cli_handler

Stoiko Ivanov s.ivanov at proxmox.com
Tue May 29 16:30:11 CEST 2018


Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PVE/CLIHandler.pm  | 8 ++++----
 src/PVE/RESTHandler.pm | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
index 222051d..58e7a05 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -487,9 +487,9 @@ my $handle_cmd  = sub {
     my ($class, $name, $arg_param, $uri_param, $outsub) = @{$def || []};
     $abort->("unknown command '$cmd_str'") if !$class;
 
-    my $res = $class->cli_handler($cmd_str, $name, $cmd_args, $arg_param, $uri_param, $read_password_func, $param_mapping_func);
+    my ($res,$info) = $class->cli_handler($cmd_str, $name, $cmd_args, $arg_param, $uri_param, $read_password_func, $param_mapping_func);
 
-    &$outsub($res) if $outsub;
+    &$outsub($res, $info) if $outsub;
 };
 
 my $handle_simple_cmd = sub {
@@ -522,9 +522,9 @@ my $handle_simple_cmd = sub {
 
     &$preparefunc() if $preparefunc;
 
-    my $res = $class->cli_handler($name, $name, \@ARGV, $arg_param, $uri_param, $read_password_func, $param_mapping_func);
+    my ($res, $info) = $class->cli_handler($name, $name, \@ARGV, $arg_param, $uri_param, $read_password_func, $param_mapping_func);
 
-    &$outsub($res) if $outsub;
+    &$outsub($res,$info) if $outsub;
 };
 
 sub run_cli_handler {
diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm
index 5e70503..a99ed47 100644
--- a/src/PVE/RESTHandler.pm
+++ b/src/PVE/RESTHandler.pm
@@ -758,7 +758,7 @@ sub cli_handler {
 	die $err;
     }
 
-    return $res;
+    return ($res, $info);
 }
 
 # utility methods
-- 
2.11.0





More information about the pve-devel mailing list