]> git.proxmox.com Git - pve-access-control.git/commitdiff
setup_default_cli_env: expect $class as first parameter
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 12 Jan 2017 12:53:18 +0000 (13:53 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 12 Jan 2017 12:53:18 +0000 (13:53 +0100)
PVE/RPCEnvironment.pm

index 30415ebe4f3ca85d99652426a913f0ad59b831c0..b1ed897b5bc48394b5edd4e04d80af7906486f3d 100644 (file)
@@ -515,13 +515,15 @@ sub init {
 
 # convenience function for command line tools
 sub setup_default_cli_env {
-    my ($username) = @_;
+    my ($class, $username) = @_;
+
+    $class = ref($class) || $class;
 
     $username //= 'root@pam';
 
     PVE::INotify::inotify_init();
 
-    my $rpcenv = PVE::RPCEnvironment->init('cli');
+    my $rpcenv = $class->init('cli');
     $rpcenv->init_request();
     $rpcenv->set_language($ENV{LANG});
     $rpcenv->set_user($username);