[pve-devel] [PATCH pve-manager 7/9] remove base_handler_class - directly use PVE::API2 instead

Dietmar Maurer dietmar at proxmox.com
Mon Jan 16 10:59:37 CET 2017


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/HTTPServer.pm         | 6 +-----
 PVE/Service/pvedaemon.pm  | 1 -
 PVE/Service/pveproxy.pm   | 1 -
 PVE/Service/spiceproxy.pm | 1 -
 4 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/PVE/HTTPServer.pm b/PVE/HTTPServer.pm
index ab8526b..299b816 100755
--- a/PVE/HTTPServer.pm
+++ b/PVE/HTTPServer.pm
@@ -131,12 +131,8 @@ sub rest_handler {
 
     my $rpcenv = $self->{rpcenv};
 
-    my $base_handler_class = $self->{base_handler_class};
-
-    die "no base handler - internal error" if !$base_handler_class;
-
     my $uri_param = {};
-    my ($handler, $info) = $base_handler_class->find_handler($method, $rel_uri, $uri_param);
+    my ($handler, $info) = PVE::API2->find_handler($method, $rel_uri, $uri_param);
     if (!$handler || !$info) {
 	$rpcenv->set_user(undef); # clear after request
 	return {
diff --git a/PVE/Service/pvedaemon.pm b/PVE/Service/pvedaemon.pm
index 173a89c..486d264 100755
--- a/PVE/Service/pvedaemon.pm
+++ b/PVE/Service/pvedaemon.pm
@@ -34,7 +34,6 @@ sub init {
     my $socket = $self->create_reusable_socket(85, '127.0.0.1');
 
     $self->{server_config} = {
-	base_handler_class => 'PVE::API2',
 	keep_alive => 100,
 	max_conn => 500,
 	max_requests => 1000,
diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index a115dcd..25dae23 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -75,7 +75,6 @@ sub init {
     add_dirs($dirs, '/novnc/' => '/usr/share/novnc-pve/');
 
     $self->{server_config} = {
-	base_handler_class => 'PVE::API2',
 	title => 'Proxmox VE API',
 	keep_alive => 100,
 	max_conn => 500,
diff --git a/PVE/Service/spiceproxy.pm b/PVE/Service/spiceproxy.pm
index e9f010d..20fd5b2 100755
--- a/PVE/Service/spiceproxy.pm
+++ b/PVE/Service/spiceproxy.pm
@@ -44,7 +44,6 @@ sub init {
     my $socket = $self->create_reusable_socket(3128, undef, $family);
 
     $self->{server_config} = {
-	base_handler_class => 'PVE::API2',
 	keep_alive => 0,
 	max_conn => 500,
 	lockfile => $accept_lock_fn,
-- 
2.1.4




More information about the pve-devel mailing list