5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-02-03 13:47:15 +03:00

remove vm access permissions after destroy

removed duplicated code which was used in
PVE::AccessControl -> now in PVE::API2::Qemu

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
This commit is contained in:
Alen Grizonic 2015-08-13 12:21:36 +02:00 committed by Dietmar Maurer
parent cee01bcbd7
commit 37f438057a

View File

@ -1140,17 +1140,6 @@ __PACKAGE__->register_method({
my $storecfg = PVE::Storage::config();
my $delVMfromPoolFn = sub {
my $usercfg = cfs_read_file("user.cfg");
if (my $pool = $usercfg->{vms}->{$vmid}) {
if (my $data = $usercfg->{pools}->{$pool}) {
delete $data->{vms}->{$vmid};
delete $usercfg->{vms}->{$vmid};
cfs_write_file("user.cfg", $usercfg);
}
}
};
my $realcmd = sub {
my $upid = shift;
@ -1158,7 +1147,7 @@ __PACKAGE__->register_method({
PVE::QemuServer::vm_destroy($storecfg, $vmid, $skiplock);
PVE::AccessControl::remove_vm_from_pool($vmid);
PVE::AccessControl::remove_vm_access($vmid);
};
return $rpcenv->fork_worker('qmdestroy', $vmid, $authuser, $realcmd);