Fix #936: ceph: support multiple roots in osd tree

The OSD tree in our GUI otherwise only shows the "first"
root it finds in the crush map.
This commit is contained in:
Wolfgang Bumiller 2016-04-12 09:56:04 +02:00 committed by Dietmar Maurer
parent eca5c8b1dc
commit 4aed5e3e3a
2 changed files with 6 additions and 5 deletions

View File

@ -138,17 +138,16 @@ __PACKAGE__->register_method ({
}
}
my $rootnode;
my $roots = [];
foreach my $e (@{$res->{nodes}}) {
if (!$nodes->{$e->{id}}->{parent}) {
$rootnode = $newnodes->{$e->{id}};
last;
push @$roots, $newnodes->{$e->{id}};
}
}
die "no root node\n" if !$rootnode;
die "no root node\n" if !@$roots;
my $data = { root => $rootnode };
my $data = { root => { leaf => 0, children => $roots } };
return $data;
}});

View File

@ -7,6 +7,8 @@ pve-manager (4.1-27) unstable; urgency=medium
* qemu monitor GUI: support page up/down
* Fix #936: ceph: support multiple roots in osd tree
-- Proxmox Support Team <support@proxmox.com> Tue, 12 Apr 2016 17:12:09 +0200
pve-manager (4.1-26) unstable; urgency=medium