cli: return info of all nodes when doing garage stats -a (fix #814)
This commit is contained in:
parent
63f20bdeab
commit
d84308c413
1 changed files with 6 additions and 1 deletions
|
@ -146,7 +146,12 @@ impl AdminRpcHandler {
|
||||||
async fn handle_stats(&self, opt: StatsOpt) -> Result<AdminRpc, Error> {
|
async fn handle_stats(&self, opt: StatsOpt) -> Result<AdminRpc, Error> {
|
||||||
if opt.all_nodes {
|
if opt.all_nodes {
|
||||||
let mut ret = String::new();
|
let mut ret = String::new();
|
||||||
let all_nodes = self.garage.system.cluster_layout().all_nodes().to_vec();
|
let mut all_nodes = self.garage.system.cluster_layout().all_nodes().to_vec();
|
||||||
|
for node in self.garage.system.get_known_nodes().iter() {
|
||||||
|
if node.is_up && !all_nodes.contains(&node.id) {
|
||||||
|
all_nodes.push(node.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for node in all_nodes.iter() {
|
for node in all_nodes.iter() {
|
||||||
let mut opt = opt.clone();
|
let mut opt = opt.clone();
|
||||||
|
|
Loading…
Add table
Reference in a new issue