]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/CLIHandler.pm
defer some daemon setup routines
[pve-common.git] / src / PVE / CLIHandler.pm
index 33011c691c17c23c4b96769c1ecb1c3905ef7d79..2e7b14dc0e26479b05c498626da7203c77bba20d 100644 (file)
@@ -158,7 +158,7 @@ sub print_usage_short {
 }
 
 sub handle_cmd {
-    my ($def, $cmdname, $cmd, $args, $pwcallback, $podfn) = @_;
+    my ($def, $cmdname, $cmd, $args, $pwcallback, $podfn, $preparefunc) = @_;
 
     $cmddef = $def;
     $exename = $cmdname;
@@ -176,6 +176,8 @@ sub handle_cmd {
        return;
     }
 
+    &$preparefunc() if $preparefunc;
+
     $cmd = &$expand_command_name($cmddef, $cmd);
 
     my ($class, $name, $arg_param, $uri_param, $outsub) = @{$cmddef->{$cmd} || []};