2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

modified review comments from ErTao

This commit is contained in:
Casandra Qiu 2016-11-21 13:53:42 -05:00
parent 91b67db411
commit eeb750f592
2 changed files with 6 additions and 12 deletions

View File

@ -771,7 +771,7 @@ sub nmap_scan {
if ($osguess_ips) {
my $guess_switches = nmap_osguess($request, $osguess_ips);
foreach my $guess_mac ( keys %$guess_switches ) {
$switches->{$guess_mac}->{ip} = $guess_switches->{$guess_mac}->{ip};;
$switches->{$guess_mac}->{ip} = $guess_switches->{$guess_mac}->{ip};
$switches->{$guess_mac}->{vendor} = $guess_switches->{$guess_mac}->{vendor};
}
}

View File

@ -89,6 +89,10 @@ if ($::SWITCH) {
exit(1);
}
#get mac address for the switches
my $mactab = xCAT::Table->new("mac");
my $machash = $mactab->getNodesAttribs(\@nodes,['mac']);
my $switches = join(",",@nodes);
my $cmd;
my $vlan;
@ -125,9 +129,6 @@ sub config_ip {
if ($nettab) {
@nets = $nettab->getAllAttribs('net','mask');
}
#get mac address for the switches
my $mactab = xCAT::Table->new("mac");
my $machash = $mactab->getNodesAttribs(\@nodes,['mac']);
foreach my $switch (@nodes) {
print "change $switch to static ip address\n";
@ -165,7 +166,7 @@ sub config_ip {
# if hostnames are same, created different one for discovery name
if ($dswitch eq $switch) {
$dswitch="";
$dswitch="$switch-discovery";
}
#if not defined, need to create one for xdsh to use
@ -243,9 +244,6 @@ sub config_hostname {
my $switchtab = xCAT::Table->new('switches');
my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername','sshpassword']);
#get mac address for the switches
my $mactab = xCAT::Table->new("mac");
my $machash = $mactab->getNodesAttribs(\@nodes,['mac']);
foreach my $switch (@nodes) {
my $user= $switchhash->{$switch}->[0]->{sshusername};
my $pwd= $switchhash->{$switch}->[0]->{sshpassword};
@ -300,10 +298,6 @@ sub config_snmp {
$snmp_group = "xcatgroup\r";
}
#get mac address for the switches
my $mactab = xCAT::Table->new("mac");
my $machash = $mactab->getNodesAttribs(\@nodes,['mac']);
foreach my $switch (@nodes) {
my $mysw;