mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Fixing bug 3339: check if the kitomponent is existing before adidng it.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15033 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -1014,6 +1014,21 @@ sub addkit | ||||
|             return 1; | ||||
|         } | ||||
|  | ||||
|         # Check if the kitcomponent is existing | ||||
|         my @kitcomps = $tabs{kitcomponent}->getAllAttribs( 'kitcompname' ); | ||||
|         foreach my $kitcomp (@kitcomps) { | ||||
|             if ( $kitcomp->{kitcompname} ) { | ||||
|                 foreach my $kitcompid (keys %kitcomphash) { | ||||
|                     if ( $kitcomphash{$kitcompid}{kitcompname} and $kitcomphash{$kitcompid}{kitcompname} =~ /$kitcomp->{kitcompname}/ ) { | ||||
|                         my %rsp; | ||||
|                         push@{ $rsp{data} }, "Failed to add kitcomponent $kitcomp->{kitcompname} because it is already existing"; | ||||
|                         xCAT::MsgUtils->message( "E", \%rsp, $callback ); | ||||
|                         return 1; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         my %rsp; | ||||
|         push@{ $rsp{data} }, "Adding Kit $kithash{kitname}"; | ||||
|         xCAT::MsgUtils->message( "I", \%rsp, $callback ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user