mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 22:49:03 +00:00
correct use hash with keys
This commit is contained in:
parent
915a73d67b
commit
025e1d900b
@ -687,7 +687,7 @@ __PACKAGE__->register_method({
|
|||||||
delete $conf->{snapshots};
|
delete $conf->{snapshots};
|
||||||
|
|
||||||
if (!$param->{current}) {
|
if (!$param->{current}) {
|
||||||
foreach my $opt (keys $conf->{pending}) {
|
foreach my $opt (keys %{$conf->{pending}}) {
|
||||||
next if $opt eq 'delete';
|
next if $opt eq 'delete';
|
||||||
my $value = $conf->{pending}->{$opt};
|
my $value = $conf->{pending}->{$opt};
|
||||||
next if ref($value); # just to be sure
|
next if ref($value); # just to be sure
|
||||||
@ -758,7 +758,7 @@ __PACKAGE__->register_method({
|
|||||||
|
|
||||||
my $res = [];
|
my $res = [];
|
||||||
|
|
||||||
foreach my $opt (keys $conf) {
|
foreach my $opt (keys %$conf) {
|
||||||
next if ref($conf->{$opt});
|
next if ref($conf->{$opt});
|
||||||
my $item = { key => $opt };
|
my $item = { key => $opt };
|
||||||
$item->{value} = $conf->{$opt} if defined($conf->{$opt});
|
$item->{value} = $conf->{$opt} if defined($conf->{$opt});
|
||||||
@ -767,7 +767,7 @@ __PACKAGE__->register_method({
|
|||||||
push @$res, $item;
|
push @$res, $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $opt (keys $conf->{pending}) {
|
foreach my $opt (keys %{$conf->{pending}}) {
|
||||||
next if $opt eq 'delete';
|
next if $opt eq 'delete';
|
||||||
next if ref($conf->{pending}->{$opt}); # just to be sure
|
next if ref($conf->{pending}->{$opt}); # just to be sure
|
||||||
next if defined($conf->{$opt});
|
next if defined($conf->{$opt});
|
||||||
|
Loading…
Reference in New Issue
Block a user