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

Ignore 'File exists' error from storage pool build

This commit is contained in:
Mark Gurevich
2016-06-17 10:35:03 -04:00
parent fddd78e1ec
commit 65246bdc01

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 $@;
}
}