add setup_environment hooks to CLIHandler classes
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
3656c0b9f3
commit
8a37d2c9c2
@ -25,6 +25,10 @@ my $upid_exit = sub {
|
||||
exit($status eq 'OK' ? 0 : -1);
|
||||
};
|
||||
|
||||
sub setup_environment {
|
||||
PVE::RPCEnvironment->setup_default_cli_env();
|
||||
}
|
||||
|
||||
__PACKAGE__->register_method ({
|
||||
name => 'update',
|
||||
path => 'update',
|
||||
|
@ -32,6 +32,10 @@ my $upid_exit = sub {
|
||||
exit($status eq 'OK' ? 0 : -1);
|
||||
};
|
||||
|
||||
sub setup_environment {
|
||||
PVE::RPCEnvironment->setup_default_cli_env();
|
||||
}
|
||||
|
||||
__PACKAGE__->register_method ({
|
||||
name => 'purge',
|
||||
path => 'purge',
|
||||
|
@ -14,6 +14,10 @@ use base qw(PVE::CLIHandler);
|
||||
|
||||
my $nodename = PVE::INotify::nodename();
|
||||
|
||||
sub setup_environment {
|
||||
PVE::RPCEnvironment->setup_default_cli_env();
|
||||
}
|
||||
|
||||
our $cmddef = {
|
||||
update => [ 'PVE::API2::Subscription', 'update', undef, { node => $nodename } ],
|
||||
get => [ 'PVE::API2::Subscription', 'get', undef, { node => $nodename },
|
||||
|
@ -3,11 +3,16 @@ package PVE::CLI::vzdump;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use PVE::RPCEnvironment;
|
||||
use PVE::CLIHandler;
|
||||
use PVE::API2::VZDump;
|
||||
|
||||
use base qw(PVE::CLIHandler);
|
||||
|
||||
sub setup_environment {
|
||||
PVE::RPCEnvironment->setup_default_cli_env();
|
||||
}
|
||||
|
||||
# Note: use string 'vmid' as $arg_param option, to allow vmid lists
|
||||
our $cmddef = [ 'PVE::API2::VZDump', 'vzdump', 'vmid', undef,
|
||||
sub {
|
||||
|
Loading…
x
Reference in New Issue
Block a user