From: Dietmar Maurer Date: Thu, 12 Jan 2017 09:12:14 +0000 (+0100) Subject: remove calls to PVE::RPCEnvironment X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=1042b82cc1b86895f89398e70ff4fa5601f6df5c remove calls to PVE::RPCEnvironment This introduces a cyclic dependency, so we need to remove this. PVE::CLI::* classes should instead add ad call to PVE::RPCEnvironment->setup_default_cli_env(); Signed-off-by: Dietmar Maurer --- diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index e2a81a0..199241f 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -472,14 +472,12 @@ sub run_cli_handler { foreach my $key (keys %params) { next if $key eq 'prepare'; - next if $key eq 'no_init'; # used by lxc hooks - next if $key eq 'no_rpcenv'; + next if $key eq 'no_init'; # not used anymore + next if $key eq 'no_rpcenv'; # not used anymore die "unknown parameter '$key'"; } my $preparefunc = $params{prepare}; - my $no_init = $params{no_init}; - my $no_rpcenv = $params{no_rpcenv}; my $pwcallback = $class->can('read_password'); my $stringfilemap = $class->can('string_param_file_mapping'); @@ -490,15 +488,6 @@ sub run_cli_handler { if ($class !~ m/^PVE::Service::/) { die "please run as root\n" if $> != 0; - - PVE::INotify::inotify_init() if !$no_init; - - if (!$no_rpcenv) { - my $rpcenv = PVE::RPCEnvironment->init('cli'); - $rpcenv->init_request() if !$no_init; - $rpcenv->set_language($ENV{LANG}); - $rpcenv->set_user('root@pam'); - } } no strict 'refs';