[pve-devel] [PATCH pve-manager 2/9] pveproxy.pm: use PVE::APIServer::AnyEvent::add_dirs()

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


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/Service/pveproxy.pm | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index fe133d5..c354888 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -9,7 +9,6 @@ use HTTP::Response;
 use Encode;
 use URI;
 use URI::QueryParam;
-use File::Find;
 use Data::Dumper;
 use PVE::API2Tools;
 use PVE::API2;
@@ -44,17 +43,7 @@ my $daemon = __PACKAGE__->new('pveproxy', $cmdline, %daemon_options);
 sub add_dirs {
     my ($result_hash, $alias, $subdir) = @_;
 
-    $result_hash->{$alias} = $subdir;
-
-    my $wanted = sub {
-	my $dir = $File::Find::dir;
-	if ($dir =~m!^$subdir(.*)$!) {
-	    my $name = "$alias$1/";
-	    $result_hash->{$name} = "$dir/";
-	}
-    };
-
-    find({wanted => $wanted, follow => 0, no_chdir => 1}, $subdir);
+    PVE::APIServer::AnyEvent::add_dirs($result_hash, $alias, $subdir);
 }
 
 sub init {
-- 
2.1.4




More information about the pve-devel mailing list