re-add hack for empty pool

fresh created and empty rbd pool, throw a 500 error with "pool xxx doesn't contain rbd images" message.
This commit is contained in:
Dietmar Maurer
2012-07-18 06:04:09 +02:00
parent f7a1e35f69
commit 8c3abf126f

View File

@ -32,7 +32,7 @@ sub rbd_ls {
my $list = {};
run_command($cmd, errmsg => "rbd error", errfunc => sub {}, outfunc => sub {
my $parser = sub {
my $line = shift;
if ($line =~ m/^(vm-(\d+)-\S+)$/) {
@ -44,7 +44,14 @@ sub rbd_ls {
vmid => $owner
};
}
});
};
eval {
run_command($cmd, errmsg => "rbd error", errfunc => sub {}, outfunc => $parser);
};
my $err = $@;
die $err if $err && $err !~ m/doesn't contain rbd images/ ;
return $list;
}