[pve-devel] applied: [PATCH pve-ha-manager] add setup_environment hook to CLIHandler class
Dietmar Maurer
dietmar at proxmox.com
Thu Jan 12 13:13:09 CET 2017
And use run_cli_handler instead of depreciated run_cli.
Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
src/PVE/CLI/ha_manager.pm | 5 +++++
src/ha-manager | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/PVE/CLI/ha_manager.pm b/src/PVE/CLI/ha_manager.pm
index 9d1f7e2..44d7bf2 100644
--- a/src/PVE/CLI/ha_manager.pm
+++ b/src/PVE/CLI/ha_manager.pm
@@ -10,6 +10,7 @@ use JSON;
use PVE::JSONSchema qw(get_standard_option);
use PVE::CLIHandler;
use PVE::Cluster;
+use PVE::RPCEnvironment;
use PVE::HA::Env::PVE2;
use PVE::HA::Tools;
@@ -35,6 +36,10 @@ my $timestamp_to_status = sub {
}
};
+sub setup_environment {
+ PVE::RPCEnvironment->setup_default_cli_env();
+}
+
__PACKAGE__->register_method ({
name => 'status',
path => 'status',
diff --git a/src/ha-manager b/src/ha-manager
index f42428d..f7576be 100755
--- a/src/ha-manager
+++ b/src/ha-manager
@@ -11,4 +11,4 @@ my $prepare = sub {
PVE::Cluster::cfs_update();
};
-PVE::CLI::ha_manager->run_cli(undef, undef, $prepare);
+PVE::CLI::ha_manager->run_cli_handler(prepare => $prepare);
--
2.1.4
More information about the pve-devel
mailing list