From 63cf0b6641f341a8d22eb5f3dd168cd9ba568b19 Mon Sep 17 00:00:00 2001 From: timansky Date: Thu, 27 Mar 2025 01:52:54 +0500 Subject: [PATCH] Removed unnecesary if (#61) --- PureStoragePlugin.pm | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/PureStoragePlugin.pm b/PureStoragePlugin.pm index 51c2518..a228170 100644 --- a/PureStoragePlugin.pm +++ b/PureStoragePlugin.pm @@ -1053,24 +1053,21 @@ sub map_volume { }; # Wait for the device to appear - if ( wait_for( $path_exists, "volume \"$volname\" to map" ) ) { + wait_for( $path_exists, "volume \"$volname\" to map", 30 ); - # we might end up with operational disk but without multipathing, e.g. - # if unmapping was interrupted ('remove map' was already done, but slaves were not removed) - if ( !multipath_check( $wwid ) ) { - print "Debug :: Adding multipath map for device \"$wwid\"\n" if $DEBUG; - exec_command( [ 'multipathd', 'add', 'map', $wwid ] ); + # we might end up with operational disk but without multipathing, e.g. + # if unmapping was interrupted ('remove map' was already done, but slaves were not removed) + if ( !multipath_check( $wwid ) ) { + print "Debug :: Adding multipath map for device \"$wwid\"\n" if $DEBUG; + exec_command( [ 'multipathd', 'add', 'map', $wwid ] ); - # Wait for multipath to be fully established - my $multipath_ready = sub { - return multipath_check( $wwid ); - }; - wait_for( $multipath_ready, "multipath map for volume \"$volname\" to be ready", 30, 0.5 ); - } - return $path; + # Wait for multipath to be fully established + my $multipath_ready = sub { + return multipath_check( $wwid ); + }; + wait_for( $multipath_ready, "multipath map for volume \"$volname\" to be ready", 30 ); } - - die "Error :: Local path \"$path\" does not exist.\n"; + return $path; } sub unmap_volume {