mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 10:39:49 +00:00
api2tools: refactor get_resource_pool_guest_members and declare missing use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
16f5b2834e
commit
5ab9a24383
@ -8,6 +8,7 @@ use PVE::Exception qw(raise_param_exc);
|
|||||||
use PVE::Tools;
|
use PVE::Tools;
|
||||||
use PVE::INotify;
|
use PVE::INotify;
|
||||||
use PVE::Cluster;
|
use PVE::Cluster;
|
||||||
|
use PVE::RPCEnvironment;
|
||||||
use Digest::MD5 qw(md5_hex);
|
use Digest::MD5 qw(md5_hex);
|
||||||
use URI;
|
use URI;
|
||||||
use URI::Escape;
|
use URI::Escape;
|
||||||
@ -241,17 +242,11 @@ sub get_resource_pool_guest_members {
|
|||||||
|
|
||||||
my $data = $usercfg->{pools}->{$pool};
|
my $data = $usercfg->{pools}->{$pool};
|
||||||
|
|
||||||
die "pool '$pool' does not exist\n"
|
die "pool '$pool' does not exist\n" if !$data;
|
||||||
if !$data;
|
|
||||||
|
|
||||||
my $members = [];
|
my $pool_members = [ grep { $idlist->{$_} } keys %{$data->{vms}} ];
|
||||||
|
|
||||||
foreach my $vmid (keys %{$data->{vms}}) {
|
return $pool_members;
|
||||||
my $vmdata = $idlist->{$vmid};
|
|
||||||
next if !$vmdata;
|
|
||||||
push @$members, $vmid;
|
|
||||||
}
|
|
||||||
return $members;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user