From 3560655bc684b5d4e6ad9b4e9aa1106997db9945 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Sat, 27 Apr 2013 02:30:38 +0000 Subject: [PATCH] fix bug 3531: New CMM firmware is adding node # ( textid ) wrapper around textd - breaks rscan -u git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16090 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 0e8bcaf3d..c61106de2 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1577,7 +1577,13 @@ sub rscan { if ($name =~ /Comm Error/) { next; } - + if ($data[1] =~ /\(\s*([^\s]*)\s*\)/) { + $name = $1; + } elsif ($data[1] =~ /^\s*([^s]*)\s*$/) { + $name = $1; + $name =~ s/ /_/; + $name =~ tr/A-Z/a-z/; + } if (exists($opt{u})) { ## TRACE_LINE print "Rscan: orig_name [$name]\n"; @@ -1825,7 +1831,17 @@ sub rscan_stanza { if ($data[1] =~ /Comm Error/) { next; } - $result .= "$data[1]:\n\tobjtype=node\n"; + my $objname; + if ($data[1] =~ /\(\s*([^\s]*)\s*\)/) { + $objname = $1; + } elsif ($data[1] =~ /^\s*([^s]*)\s*$/) { + $objname = $1; + $objname =~ s/ /_/; + $objname =~ tr/A-Z/a-z/; + } else { + $objname = $data[1]; + } + $result .= "$objname:\n\tobjtype=node\n"; foreach ( @rscan_attribs ) { my $d = $data[$i++];