From 398f9ceac8c20705f573671bde4bc482967f5c13 Mon Sep 17 00:00:00 2001 From: Jens Remus Date: Thu, 10 Nov 2016 12:35:43 +0100 Subject: [PATCH] lsluns: do not scan (all) if filters match nothing Fix the following undesired behavior of lsluns to scan all resources if the user provided filters did not match anything: No valid combination found for adapter '5080'. Removing from resource list. No valid parameters left, using all available resources in system. Scanning for LUNs on adapter 0.0.5080 ... Scanning can be resource consumptive. So if a user already wants to filter, possibly to reduce resource consumption, he does not want to happen to scan everything and thus consume the worst case of resources. Instead print a message to inform the user why nothing was scanned. Reported-by: Steffen Maier Signed-off-by: Jens Remus Reviewed-by: Steffen Maier Reviewed-by: Benjamin Block Signed-off-by: Michael Holzheu --- zconf/lsluns | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/zconf/lsluns b/zconf/lsluns index 2c2fdec4..43af5102 100755 --- a/zconf/lsluns +++ b/zconf/lsluns @@ -219,7 +219,6 @@ sub get_env_list @res = ; return () if (!@res); -reload: foreach my $entry (@res) { my $a = ${[split('/', $entry)]}[-2]; my $p = ${[split('/', $entry)]}[-1]; @@ -243,12 +242,7 @@ reload: } if (!%res_hash) { - print "\nNo valid parameters left, ", - "using all available resources in system.\n\n"; - @$a_ref_list = (); - @$p_ref_list = (); - @t_arr = (); - goto reload; + print "$PROGRAM_NAME: Adapter and/or port filter(s) did not match anything\n"; } return %res_hash; }