From 8067ecb0e14a705945c093d30d78de6a8591a69d Mon Sep 17 00:00:00 2001 From: qyin Date: Sun, 28 Apr 2013 05:49:39 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/profilednodes.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index 3b202fc34..c224b59b9 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -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.");