From: Dietmar Maurer Date: Fri, 2 Oct 2015 11:41:15 +0000 (+0200) Subject: run_cli_handler: add no_init for lxc mount hook X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=5ffbe2f10ac9c4b7f95cfde9ff91e542ac32b07c;ds=sidebyside run_cli_handler: add no_init for lxc mount hook --- diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index c62837b..f973bdc 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -482,11 +482,13 @@ sub run_cli_handler { foreach my $key (keys %params) { next if $key eq 'podfn'; next if $key eq 'prepare'; + next if $key eq 'no_init'; # used by lxc hooks die "unknown parameter '$key'"; } my $podfn = $params{podfn}; my $preparefunc = $params{prepare}; + my $no_init = $params{no_init}; my $pwcallback = $class->can('read_password'); @@ -497,10 +499,10 @@ sub run_cli_handler { if ($class !~ m/^PVE::Service::/) { die "please run as root\n" if $> != 0; - PVE::INotify::inotify_init(); + PVE::INotify::inotify_init() if !$no_init; my $rpcenv = PVE::RPCEnvironment->init('cli'); - $rpcenv->init_request(); + $rpcenv->init_request() if !$no_init; $rpcenv->set_language($ENV{LANG}); $rpcenv->set_user('root@pam'); }