2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 11:10:24 +00:00

Merge pull request #1331 from gurevichmark/kvm_storage_pool_create

Ignore 'File exists' error from storage pool build
This commit is contained in:
Victor Hu
2016-06-22 16:59:38 -04:00
committed by GitHub

View File

@@ -234,7 +234,10 @@ sub get_storage_pool_by_url {
eval { $poolobj->build(); };
if ($@) {
my $error = $@;
unless ($error =~ /vgcreate.*exit status 3/ or $error =~ /pvcreate.*exit status 5/) {
# Some errors from building storage pool object are safe to ignore.
# For example, "File exists" is returned when a directory location for storage pool is already there.
# The storage pool still gets built, and the next statement to create storage pool will work.
unless ($error =~ /vgcreate.*exit status 3/ or $error =~ /pvcreate.*exit status 5/ or $error =~ /File exists/) {
die $@;
}
}