-my $build_pve_api_path_hash;
-$build_pve_api_path_hash = sub {
- my ($tree) = @_;
-
- my $class = ref($tree);
- return $tree if !$class;
-
- if ($class eq 'ARRAY') {
- foreach my $el (@$tree) {
- $build_pve_api_path_hash->($el);
- }
- } elsif ($class eq 'HASH') {
- if (defined($tree->{leaf}) && defined(my $path = $tree->{path})) {
- $pve_api_path_hash->{$path} = $tree;
- }
- foreach my $k (keys %$tree) {
- $build_pve_api_path_hash->($tree->{$k});
- }
- }
-};
-