mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-08-05 01:06:59 +00:00
setup_default_cli_env: expect $class as first parameter
This commit is contained in:
parent
9595066e5f
commit
86c4f1e6d1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user