]> git.proxmox.com Git - pve-manager.git/commitdiff
pveproxy.pm: use PVE::APIServer::AnyEvent::add_dirs()
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 16 Jan 2017 09:59:32 +0000 (10:59 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 16 Jan 2017 10:54:33 +0000 (11:54 +0100)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
PVE/Service/pveproxy.pm

index fe133d57f22ae1e8f1f8cda676af70c16e192e1a..c354888f747c9bad0eb51a2ec0387324d3ccaab4 100755 (executable)
@@ -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 {