_cat/allocation: disk.avail can be zero, if so, want to show 100%
Closes #4835
This commit is contained in:
parent
92d4cc13c0
commit
d4f0323917
|
@ -153,7 +153,7 @@ public class RestAllocationAction extends AbstractCatAction {
|
|||
long avail = nodeStats.getFs().getTotal().getAvailable().bytes();
|
||||
|
||||
short diskPercent = -1;
|
||||
if (used >= 0 && avail > 0) {
|
||||
if (used >= 0 && avail >= 0) {
|
||||
diskPercent = (short) (used * 100 / (used + avail));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue