also return the ceph flags in osd api call

we want to set/get the flags in the ceph/osd tab, so we have to
return it there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-11-30 11:52:06 +01:00 committed by Dietmar Maurer
parent 5e3fd48d19
commit 85c17d9673

View File

@ -30,6 +30,8 @@ my $get_osd_status = sub {
my $osdlist = $stat->{osds} || [];
my $flags = $stat->{flags} || undef;
my $osdstat;
foreach my $d (@$osdlist) {
$osdstat->{$d->{osd}} = $d if defined($d->{osd});
@ -39,7 +41,7 @@ my $get_osd_status = sub {
return $osdstat->{$osdid};
}
return $osdstat;
return wantarray? ($osdstat, $flags):$osdstat;
};
my $get_osd_usage = sub {
@ -86,7 +88,7 @@ __PACKAGE__->register_method ({
die "no tree nodes found\n" if !($res && $res->{nodes});
my $osdhash = &$get_osd_status($rados);
my ($osdhash, $flags) = &$get_osd_status($rados);
my $usagehash = &$get_osd_usage($rados);
@ -151,6 +153,9 @@ __PACKAGE__->register_method ({
my $data = { root => { leaf => 0, children => $roots } };
# we want this for the noout flag
$data->{flags} = $flags if $flags;
return $data;
}});