]> git.proxmox.com Git - pve-common.git/commitdiff
remove calls to PVE::RPCEnvironment
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 12 Jan 2017 09:12:14 +0000 (10:12 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 13 Jan 2017 09:07:18 +0000 (10:07 +0100)
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 <dietmar@proxmox.com>
src/PVE/CLIHandler.pm

index e2a81a0a8c0866051940d15382619676d93e1e27..199241f0ae5288748ceef2586714301e8aeb4fa4 100644 (file)
@@ -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';