Co-authored-by: Julio Jimenez Delgado <j.jimenez.delgado@ibermatica.com> Refs: CTOR-851
This commit is contained in:
parent
2a81f01250
commit
69144e3895
|
@ -128,14 +128,16 @@ sub manage_selection {
|
|||
}
|
||||
|
||||
my ($total, $free) = ($_->{totalCapacity} * 1024 * 1024, $_->{totalFreeSpace} * 1024 * 1024);
|
||||
my $fixed_total = ($total == 0) ? 1 : $total;
|
||||
|
||||
$self->{sp}->{ $_->{storagePoolEntity}->{storagePoolName} } = {
|
||||
display => $_->{storagePoolEntity}->{storagePoolName},
|
||||
status => defined($map_status_code->{ $_->{statusCode} }) ? $map_status_code->{ $_->{statusCode} } : lc($_->{status}),
|
||||
total_space => $total,
|
||||
used_space => $total - $free,
|
||||
free_space => $free,
|
||||
prct_used_space => 100 - ($free * 100 / $total),
|
||||
prct_free_space => $free * 100 / $total
|
||||
display => $_->{storagePoolEntity}->{storagePoolName},
|
||||
status => defined($map_status_code->{ $_->{statusCode} }) ? $map_status_code->{ $_->{statusCode} } : lc($_->{status}),
|
||||
total_space => $total,
|
||||
used_space => $total - $free,
|
||||
free_space => $free,
|
||||
prct_used_space => 100 - ($free * 100 / $fixed_total),
|
||||
prct_free_space => $free * 100 / $fixed_total
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue