sheepdog : parse_volname

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier
2013-02-05 12:55:45 +01:00
committed by Dietmar Maurer
parent c78cb110e7
commit 648095a9db

View File

@ -123,8 +123,8 @@ sub options {
sub parse_volname {
my ($class, $volname) = @_;
if ($volname =~ m/^(vm-(\d+)-\S+)$/) {
return ('images', $1, $2);
if ($volname =~ m/^((base-(\d+)-\S+)\/)?((base)?(vm)?-(\d+)-\S+)$/) {
return ('images', $4, $7, $2, $3, $5);
}
die "unable to parse rbd volume name '$volname'\n";