mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 14:36:27 +00:00
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:
parent
5e3fd48d19
commit
85c17d9673
@ -30,6 +30,8 @@ my $get_osd_status = sub {
|
|||||||
|
|
||||||
my $osdlist = $stat->{osds} || [];
|
my $osdlist = $stat->{osds} || [];
|
||||||
|
|
||||||
|
my $flags = $stat->{flags} || undef;
|
||||||
|
|
||||||
my $osdstat;
|
my $osdstat;
|
||||||
foreach my $d (@$osdlist) {
|
foreach my $d (@$osdlist) {
|
||||||
$osdstat->{$d->{osd}} = $d if defined($d->{osd});
|
$osdstat->{$d->{osd}} = $d if defined($d->{osd});
|
||||||
@ -39,7 +41,7 @@ my $get_osd_status = sub {
|
|||||||
return $osdstat->{$osdid};
|
return $osdstat->{$osdid};
|
||||||
}
|
}
|
||||||
|
|
||||||
return $osdstat;
|
return wantarray? ($osdstat, $flags):$osdstat;
|
||||||
};
|
};
|
||||||
|
|
||||||
my $get_osd_usage = sub {
|
my $get_osd_usage = sub {
|
||||||
@ -86,7 +88,7 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
die "no tree nodes found\n" if !($res && $res->{nodes});
|
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);
|
my $usagehash = &$get_osd_usage($rados);
|
||||||
|
|
||||||
@ -151,6 +153,9 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
my $data = { root => { leaf => 0, children => $roots } };
|
my $data = { root => { leaf => 0, children => $roots } };
|
||||||
|
|
||||||
|
# we want this for the noout flag
|
||||||
|
$data->{flags} = $flags if $flags;
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user