From e3d0fb9c9e49295faaf5ae295dd55253ac13e2a7 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Sun, 28 Apr 2013 06:28:55 +0000 Subject: [PATCH] fix bug 3536 rscan cmm -z for Blacktip blades has wrong hwtype=xblade and missing cons git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16117 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Schema.pm | 7 ++++++- xCAT-server/lib/xcat/plugins/blade.pm | 28 ++++++++++++++++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 1b64915ca..a2bb755f7 100644 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1930,6 +1930,11 @@ my @nodeattrs = ( tabentry => 'mp.nodetype', access_tabentry => 'mp.node=attr:node', }, + {attr_name => 'hwtype', + only_if => 'mgt=ipmi', + tabentry => 'mp.nodetype', + access_tabentry => 'mp.node=attr:node', + }, {attr_name => 'supernode', tabentry => 'ppc.supernode', access_tabentry => 'ppc.node=attr:node', @@ -2048,7 +2053,7 @@ my @nodeattrs = ( tabentry => 'mp.id', access_tabentry => 'mp.node=attr:node', }, - {attr_name => 'id', + {attr_name => 'slotid', only_if => 'mgt=ipmi', tabentry => 'mp.id', access_tabentry => 'mp.node=attr:node', diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 28fcccd50..e40cd30a2 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1541,7 +1541,7 @@ sub rscan { } foreach (@values ){ my @data = split /,/; - if ($data[0] eq "ppcblade") { + if ($data[0] eq "ppcblade" or $data[0] eq "xblade") { $data[0] = "blade"; } my $i = 0; @@ -1584,7 +1584,6 @@ sub rscan { $name =~ s/ /_/; $name =~ tr/A-Z/a-z/; } - if (exists($opt{u})) { ## TRACE_LINE print "Rscan: orig_name [$name]\n"; @@ -1741,7 +1740,7 @@ sub rscan_xml { my $i = 0; my $type = $data[0]; my $origtype = $type; - if ($type eq "ppcblade") { + if ($type eq "ppcblade" or $type eq "xblade") { $type = "blade"; } # ignore the blade server which status is 'Comm Error' @@ -1771,6 +1770,8 @@ sub rscan_xml { } elsif ( /^mgt$/ ) { if ($origtype eq "ppcblade") { $d = "fsp"; + } elsif ($origtype eq "xblade") { + $d = "ipmi"; } else { $d = "blade"; } @@ -1779,13 +1780,15 @@ sub rscan_xml { $d = "blade"; } elsif ($origtype eq "ppcblade"){ $d = "fsp"; + } elsif ($origtype eq "xblade") { + $d = "ipmi"; } else { $ignore = 1; } } elsif ( /^mpa$/ ) { $d = $mpa; } elsif ( /^hwtype$/ ) { - if ($origtype eq "ppcblade") { + if ($origtype eq "ppcblade" or $origtype eq "xblade") { $d = "blade"; } else { $d = $type; @@ -1796,6 +1799,10 @@ sub rscan_xml { $href->{Node}->{slotid} = $d; $d = "1"; } + elsif ($origtype eq "xblade") { + $href->{Node}->{slotid} = $d; + $ignore = 1; + } } elsif (/^hcp/) { if ($origtype eq "ppcblade") { $href->{Node}->{parent} = $mpa; @@ -1825,7 +1832,7 @@ sub rscan_stanza { my $i = 0; my $type = $data[0]; my $origtype = $type; - if ($type eq "ppcblade") { + if ($type eq "ppcblade" or $type eq "xblade") { $type = "blade"; } # ignore the blade server which status is 'Comm Error' @@ -1842,7 +1849,6 @@ sub rscan_stanza { } else { $objname = $data[1]; } - $result .= "$objname:\n\tobjtype=node\n"; foreach ( @rscan_attribs ) { @@ -1864,6 +1870,8 @@ sub rscan_stanza { } elsif ( /^mgt$/ ) { if ($origtype eq "ppcblade") { $d = "fsp"; + } elsif ($origtype eq "xblade") { + $d = "ipmi"; } else { $d = "blade"; } @@ -1872,13 +1880,15 @@ sub rscan_stanza { $d = "blade"; } elsif ($origtype eq "ppcblade"){ $d = "fsp"; + } elsif ($origtype eq "xblade") { + $d = "ipmi"; } else { $ignore = 1; } } elsif ( /^mpa$/ ) { $d = $mpa; } elsif ( /^hwtype$/ ) { - if ($origtype eq "ppcblade") { + if ($origtype eq "ppcblade" or $origtype eq "xblade") { $d = "blade"; } else { $d = $type; @@ -1889,6 +1899,10 @@ sub rscan_stanza { $result .= "\tslotid=$d\n"; $d = "1"; } + elsif ($origtype eq "xblade") { + $result .= "\tslotid=$d\n"; + $ignore = 1; + } } elsif (/^hcp/) { if ($origtype eq "ppcblade") { $result .= "\tparent=$mpa\n";