From 86c4f1e6d11a56857249fd720c800325f0835f83 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 12 Jan 2017 13:53:18 +0100 Subject: [PATCH] setup_default_cli_env: expect $class as first parameter --- 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@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.39.2