diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 7f53f67c7..0c30978ff 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -688,7 +688,7 @@ noderes => { sshusername => 'The remote login user name. It can be for ssh or telnet. If it is for telnet, please set protocol to "telnet". If the sshusername is blank, the username, password and protocol will be retrieved from the passwd table with "switch" as the key.', sshpassword => 'The remote login password. It can be for ssh or telnet. If it is for telnet, please set protocol to "telnet". If the sshusername is blank, the username, password and protocol will be retrieved from the passwd table with "switch" as the key.', protocol => 'Prorocol for running remote commands for the switch. The valid values are: ssh, telnet. ssh is the default. If the sshusername is blank, the username, password and protocol will be retrieved from the passwd table with "switch" as the key. The passwd.comments attribute is used for protocol.', - switchtype => 'The type of switch. It is used to identify the file name that implements the functions for this swithc. The valid values are: Mellanox, Cisco, BNT and Jun (for Juniper).', + switchtype => 'The type of switch. It is used to identify the file name that implements the functions for this swithc. The valid values are: Mellanox, Cisco, BNT and Juniper.', }, }, nodetype => { @@ -2749,7 +2749,7 @@ my @nodeattrs = ( tabentry => 'switches.switchtype', access_tabentry => 'switches.switch=attr:node', }, - + ); # end of @nodeattrs that applies to both nodes and groups diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index ee5cc3979..798fe05f4 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -29,7 +29,7 @@ my %global_scan_type = ( ); my %global_switch_type = ( - Juniper => "Jun", + Juniper => "Juniper", Cisco => "Cisco", BNT => "BNT", Mellanox => "Mellanox" @@ -612,10 +612,8 @@ sub lldp_scan { #-------------------------------------------------------------------------------- sub nmap_scan { my $request = shift; - my $ccmd; - send_msg($request, 0, "Discovering switches using nmap for @$ranges. It may take long time..."); ################################################# # If --range options, take iprange, if noderange is defined # us the ip addresses of the nodes. If none is define, use the @@ -623,6 +621,8 @@ sub nmap_scan { ################################################## my $ranges = get_ip_ranges($request); + send_msg($request, 0, "Discovering switches using nmap for @$ranges. It may take long time..."); + #warning the user if the range is too big foreach my $r (@$ranges) { if ($r =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d+)$/) { @@ -839,7 +839,7 @@ sub get_hostname { Arguments: vendor: switch vendor Returns: - stype: type of switch, supports Jun, Cisco, BNT and Mellanox + stype: type of switch, supports Juniper, Cisco, BNT and Mellanox =cut #-------------------------------------------------------------------------------- sub get_switchtype { @@ -851,7 +851,7 @@ sub get_switchtype { $key = $1; return $global_switch_type{$key}; } else { - return vendor; + return $vendor; } } @@ -897,10 +897,10 @@ sub xCATdB { $ret = xCAT::Utils->runxcmd( { command => ['lsdef'], arg => ['-t','node','-o',$host] }, $sub_req, 0, 1); if ($::RUNCMD_RC == 0) { - $ret = xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$host,"ip=$ip",'nodetype=switch','mgt=switch',"switchtype=$stype"] }, $sub_req, 0, 1); + $ret = xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$host,"ip=$ip",'nodetype=switch','mgt=switch',"switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1); $ret = xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$host,'-p','groups=switch'] }, $sub_req, 0, 1); } else { - $ret = xCAT::Utils->runxcmd( { command => ['mkdef'], arg => ['-t','node','-o',$host,'groups=switch',"ip=$ip",'nodetype=switch','mgt=switch',"switchtype=$stype"] }, $sub_req, 0, 1); + $ret = xCAT::Utils->runxcmd( { command => ['mkdef'], arg => ['-t','node','-o',$host,'groups=switch',"ip=$ip",'nodetype=switch','mgt=switch',"switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1); } if ($::RUNCMD_RC != 0) { diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index e8833c8c0..62b23a236 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -148,6 +148,7 @@ cp -r share/xcat/ib/scripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/ib/scripts cp share/xcat/ib/netboot/sles/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/ib/netboot/sles cp share/xcat/ib/netboot/rh/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/ib/netboot/rh cp -r share/xcat/devicetype/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/devicetype +ln -sf Jun $RPM_BUILD_ROOT/%{prefix}/share/xcat/devicetype/EthSwitch/Juniper chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/cons/* chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/ib/scripts/*