[pve-devel] applied: [PATCH pve-storage] add setup_environment hook to CLIHandler classes

Dietmar Maurer dietmar at proxmox.com
Thu Jan 12 14:12:04 CET 2017


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/CLI/qm.pm        | 4 ++++
 PVE/CLI/qmrestore.pm | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index 4789ee1..44439dd 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -34,6 +34,10 @@ my $upid_exit = sub {
 
 my $nodename = PVE::INotify::nodename();
 
+sub setup_environment {
+    PVE::RPCEnvironment->setup_default_cli_env();
+}
+
 sub run_vnc_proxy {
     my ($path) = @_;
 
diff --git a/PVE/CLI/qmrestore.pm b/PVE/CLI/qmrestore.pm
index 7214c2d..17018d2 100755
--- a/PVE/CLI/qmrestore.pm
+++ b/PVE/CLI/qmrestore.pm
@@ -14,6 +14,10 @@ use PVE::API2::Qemu;
 
 use base qw(PVE::CLIHandler);
 
+sub setup_environment {
+    PVE::RPCEnvironment->setup_default_cli_env();
+}
+
 __PACKAGE__->register_method({
     name => 'qmrestore', 
     path => 'qmrestore', 
-- 
2.1.4



More information about the pve-devel mailing list