DRBDPlugin: fix bug in status

This commit is contained in:
Dietmar Maurer
2015-03-21 11:02:47 +01:00
parent e36e2bc913
commit 5d6a88b0c4

View File

@ -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 {