mirror of
https://git.proxmox.com/git/pve-client
synced 2025-10-04 14:01:35 +00:00
remove $pve_api_path_hash - no longer used
This commit is contained in:
parent
520f543ef8
commit
5eb200482a
@ -13,7 +13,6 @@ use Encode;
|
|||||||
use HTTP::Status qw(:constants);
|
use HTTP::Status qw(:constants);
|
||||||
|
|
||||||
my $pve_api_definition;
|
my $pve_api_definition;
|
||||||
my $pve_api_path_hash;
|
|
||||||
|
|
||||||
my $pve_api_definition_fn = "/usr/share/pve-client/pve-api-definition.dat";
|
my $pve_api_definition_fn = "/usr/share/pve-client/pve-api-definition.dat";
|
||||||
|
|
||||||
@ -24,27 +23,6 @@ my $method_map = {
|
|||||||
delete => 'DELETE',
|
delete => 'DELETE',
|
||||||
};
|
};
|
||||||
|
|
||||||
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});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
my $default_output_format = 'text';
|
my $default_output_format = 'text';
|
||||||
my $client_output_format = $default_output_format;
|
my $client_output_format = $default_output_format;
|
||||||
|
|
||||||
@ -102,7 +80,6 @@ sub get_api_definition {
|
|||||||
open(my $fh, '<', $pve_api_definition_fn) ||
|
open(my $fh, '<', $pve_api_definition_fn) ||
|
||||||
die "unable to open '$pve_api_definition_fn' - $!\n";
|
die "unable to open '$pve_api_definition_fn' - $!\n";
|
||||||
$pve_api_definition = Storable::fd_retrieve($fh);
|
$pve_api_definition = Storable::fd_retrieve($fh);
|
||||||
$build_pve_api_path_hash->($pve_api_definition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $pve_api_definition;
|
return $pve_api_definition;
|
||||||
|
Loading…
Reference in New Issue
Block a user