DRBDPlugin: fix bug in status
This commit is contained in:
@ -226,22 +226,26 @@ sub list_images {
|
|||||||
sub status {
|
sub status {
|
||||||
my ($class, $storeid, $scfg, $cache) = @_;
|
my ($class, $storeid, $scfg, $cache) = @_;
|
||||||
|
|
||||||
|
my ($total, $avail, $used);
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $hdl = connect_drbdmanage_service();
|
my $hdl = connect_drbdmanage_service();
|
||||||
my ($rc, $res) = $hdl->cluster_free_query($scfg->{redundancy});
|
my ($rc, $res) = $hdl->cluster_free_query($scfg->{redundancy});
|
||||||
check_drbd_rc($rc->[0]);
|
check_drbd_rc($rc->[0]);
|
||||||
|
|
||||||
my $avail = $res;
|
$avail = $res;
|
||||||
my $used = 0; # fixme
|
$used = 0; # fixme
|
||||||
my $total = $used + $avail;
|
$total = $used + $avail;
|
||||||
|
|
||||||
return ($total, $avail, $used, 1);
|
|
||||||
};
|
};
|
||||||
|
if (my $err = $@) {
|
||||||
|
# ignore error,
|
||||||
|
# assume storage if offline
|
||||||
|
|
||||||
# ignore error,
|
return undef;
|
||||||
# assume storage if offline
|
}
|
||||||
|
|
||||||
return undef;
|
return ($total, $avail, $used, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub activate_storage {
|
sub activate_storage {
|
||||||
|
|||||||
Reference in New Issue
Block a user