From 4751f4746fcb38b04ae4027f2e926ef41ccd2f41 Mon Sep 17 00:00:00 2001 From: linggao Date: Tue, 2 Jun 2015 16:34:35 -0400 Subject: [PATCH] bug fix in switchdiscover --- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 0a8e0ef9f..07ddaf110 100755 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -206,7 +206,7 @@ sub parse_args { $globalopt{range} = $opt{range}; my @ips = split /,/, $opt{range}; foreach my $ip (@ips) { - if (($ip =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) || + if (($ip =~ /^(\d{1,3})(-\d{1,3})?\.(\d{1,3})(-\d{1,3})?\.(\d{1,3})(-\d{1,3})?\.(\d{1,3})(-\d{1,3})?$/) || ($ip =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d+)$/)) { push @iprange, $ip; } else { @@ -517,6 +517,7 @@ sub lldp_scan { $match = 1; last; } + #TODO: handles the case where the range is something like 10.2-3.4.5-6 } } if (!$match) {