fix 215709 nodeimport can use host info file mixed with switch , switchport and mac address

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16111 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
qyin 2013-04-28 05:49:39 +00:00
parent 55e71dcde5
commit 8067ecb0e1

View File

@ -408,6 +408,7 @@ Usage:
}
my $mac_addr_mode = 0;
my $switch_mode = 0;
# Parse and validate the hostinfo string. The real hostnames will be generated here.
xCAT::MsgUtils->message('S', "Parsing hostinfo string and validate it.");
my ($hostinfo_dict_ref, $invalid_records_ref) = validate_node_entries();
@ -432,8 +433,12 @@ Usage:
{
$mac_addr_mode = 1;
}
if(defined($hostinfo_dict{$mynode}{'switch'}))
{
$switch_mode = 1;
}
# cannot mix switch discovery with mac import
if(($mac_addr_mode ==1) && (defined($hostinfo_dict{$mynode}{'switch'})))
if(($mac_addr_mode == 1) && ($switch_mode == 1))
{
setrsp_progress("Failed to validate node information file.");
setrsp_errormsg("Cannot define mac import node in switch discovery hostinfo file.");