projects
/
pve-access-control.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9595066
)
setup_default_cli_env: expect $class as first parameter
author
Dietmar Maurer
<dietmar@proxmox.com>
Thu, 12 Jan 2017 12:53:18 +0000
(13:53 +0100)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Thu, 12 Jan 2017 12:53:18 +0000
(13:53 +0100)
PVE/RPCEnvironment.pm
patch
|
blob
|
blame
|
history
diff --git
a/PVE/RPCEnvironment.pm
b/PVE/RPCEnvironment.pm
index 30415ebe4f3ca85d99652426a913f0ad59b831c0..b1ed897b5bc48394b5edd4e04d80af7906486f3d 100644
(file)
--- 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);