From 720d25386688946501f1c5a3bd839faadbf0c474 Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 9 Nov 2011 09:09:21 +0000 Subject: [PATCH] fixed the bug 3428290, it has been created in another situation. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10985 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPbootseq.pm | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/FSPbootseq.pm b/perl-xCAT/xCAT/FSPbootseq.pm index a1d5a5621..4f7db174d 100644 --- a/perl-xCAT/xCAT/FSPbootseq.pm +++ b/perl-xCAT/xCAT/FSPbootseq.pm @@ -156,11 +156,12 @@ sub rbootseq { my $m; my $m_t; foreach $m (@mac_t) { - if($m =~ /([\w:]{14})!$node_name/) { + if(($m =~ /([\w:]{12})!$node_name/) || ($m =~ /([\w:]{17})!$node_name/)) { $m_t = $1; last; - } - } + } + + } if( !defined($m_t)) { $mac = $mac_t[0]; @@ -168,12 +169,18 @@ sub rbootseq { $mac = $m_t; } } + + if( $mac =~ /\:/) { + $mac =~ s/\://g; + } - if( $mac =~ /\:/) { - $mac =~ s/\://g; - } - $parameter = "mac=$mac:speed=auto,duplex=auto,$o->{server},,$o->{client},$o->{gateway},$bootp_retries,$tftp_retries,$o->{netmask},$blksize"; - + if($mac =~/^(\w{12})$/) { + + $parameter = "mac=$mac:speed=auto,duplex=auto,$o->{server},,$o->{client},$o->{gateway},$bootp_retries,$tftp_retries,$o->{netmask},$blksize"; + } else { + push @output, [$node_name, "The mac address in mac table could NOT be used for rbootseq with -net. HFI mac , or other wrong format?", -1 ]; + return( \@output ); + } } if( $opt->{hfi}) { @@ -193,9 +200,9 @@ sub rbootseq { ################################## if ( $Rc != SUCCESS ) { push @output, [$node_name,$data,$Rc]; - next; - } + } else { push @output,[$node_name, "Success", 0]; + } return( \@output );