[pve-devel] applied: [PATCH pve-access-control] setup_default_cli_env: expect $class as first parameter

Dietmar Maurer dietmar at proxmox.com
Thu Jan 12 13:58:35 CET 2017


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/RPCEnvironment.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/RPCEnvironment.pm b/PVE/RPCEnvironment.pm
index 30415eb..b1ed897 100644
--- a/PVE/RPCEnvironment.pm
+++ b/PVE/RPCEnvironment.pm
@@ -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 at 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);
-- 
2.1.4




More information about the pve-devel mailing list