From dece5f51ffe5c609ce628b757a602e08767a5bfb Mon Sep 17 00:00:00 2001 From: yinle Date: Tue, 22 Feb 2011 07:22:35 +0000 Subject: [PATCH] Fix a mistake, add hidden attribute to the stanza file git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8902 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/lsslp.pm | 32 +++++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/lsslp.pm b/xCAT-server/lib/xcat/plugins/lsslp.pm index cb452f0df..a2b0a118f 100644 --- a/xCAT-server/lib/xcat/plugins/lsslp.pm +++ b/xCAT-server/lib/xcat/plugins/lsslp.pm @@ -92,7 +92,7 @@ my @invalidiplist = ( "192.168.3.147", "192.168.3.148", "192.168.3.149", - "169.254.*.*", + "169.254.", "127.0.0.0", "127", 0, @@ -125,7 +125,7 @@ my %mgt = ( lc(TYPE_RSA) => "blade" ); -my @attribs = qw(nodetype mtm serial side otherinterfaces groups mgt id parent mac); +my @attribs = qw(nodetype mtm serial side otherinterfaces groups mgt id parent mac hidden); my $verbose = 0; my %ip_addr = (); my %slp_result = (); @@ -1632,7 +1632,7 @@ sub check_ip { } foreach (@invalidiplist) { - if ( $myip eq $_ ) + if ( $myip =~ /^($_)/ ) { return 0; } @@ -2743,6 +2743,12 @@ sub format_stanza { } } elsif ( /^otherinterfaces$/ ) { next; + } elsif (/^hidden$/) { + if ( $type =~ /^(fsp|bpa)$/ ) { + $d = "1"; + } else { + $d = "0"; + } } if ( !defined($d) ) { next; @@ -2803,9 +2809,15 @@ sub format_xml { } elsif ( /^groups$/ ) { $d = "$type,all"; } elsif ( /^mgt$/ ) { - $d = $mgt{$type}; + if ($mgt{$type} =~ /^cec$/) { + $d = "fsp"; + }elsif ($mgt{$type} =~ /^frame$/) { + $d = "bpa"; + }else { + $d = $mgt{$type}; + } } elsif ( /^id$/ ) { - if ( $type =~ /^(fsp|bpa|frame|cec)$/ ) { + if ( $type =~ /^(fsp|bpa|cec|frame)$/ ) { $d = $data[$i++]; } else { $i++; @@ -2813,7 +2825,7 @@ sub format_xml { } $i++; } elsif ( /^side$/ ) { - if ( $type !~ /^(fsp|bpa|cec|frame)$/ ) { + if ( $type !~ /^(fsp|bpa)$/ ) { next; } } elsif ( /^parent$/ ) { @@ -2822,11 +2834,17 @@ sub format_xml { } } elsif ( /^otherinterfaces$/ ) { next; + } elsif (/^hidden$/) { + if ( $type =~ /^(fsp|bpa)$/ ) { + $d = "1"; + } else { + $d = "0"; + } } - if ( !defined($d) ) { next; } + $href->{Node}->{$_} = $d; } #################################