_cat/allocation: disk.avail can be zero, if so, want to show 100%

Closes #4835
This commit is contained in:
Andrew Raines 2014-01-24 16:16:24 -06:00
parent 92d4cc13c0
commit d4f0323917
1 changed files with 1 additions and 1 deletions

View File

@ -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));
}