mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Output erros if there is any failure during DB operation, in case DB operation didn't output any error on failures.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15764 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -1145,14 +1145,32 @@ sub addkit | ||||
|             xCAT::MsgUtils->message( "I", \%rsp, $callback ); | ||||
|         } | ||||
|  | ||||
|         $tabs{kit}->setAttribs({kitname => $kithash{kitname} }, \%kithash ); | ||||
|         $rc = $tabs{kit}->setAttribs({kitname => $kithash{kitname} }, \%kithash ); | ||||
|         if($rc){ | ||||
|             my %rsp; | ||||
|             push@{ $rsp{data} }, "Failed to write kit object into xCAT DB"; | ||||
|             xCAT::MsgUtils->message( "E", \%rsp, $callback ); | ||||
|             return 1; | ||||
|         } | ||||
|  | ||||
|         foreach my $kitrepoid (keys %kitrepohash) { | ||||
|             $tabs{kitrepo}->setAttribs({kitreponame => $kitrepohash{$kitrepoid}{kitreponame} }, \%{$kitrepohash{$kitrepoid}} ); | ||||
|             $rc = $tabs{kitrepo}->setAttribs({kitreponame => $kitrepohash{$kitrepoid}{kitreponame} }, \%{$kitrepohash{$kitrepoid}} ); | ||||
|             if($rc){ | ||||
|                 my %rsp; | ||||
|                 push@{ $rsp{data} }, "Failed to write kitrepo $kitrepohash{$kitrepoid}{kitreponame} into xCAT DB"; | ||||
|                 xCAT::MsgUtils->message( "E", \%rsp, $callback ); | ||||
|                 return 1; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         foreach my $kitcompid (keys %kitcomphash) { | ||||
|             $tabs{kitcomponent}->setAttribs({kitcompname => $kitcomphash{$kitcompid}{kitcompname} }, \%{$kitcomphash{$kitcompid}} ); | ||||
|             $rc = $tabs{kitcomponent}->setAttribs({kitcompname => $kitcomphash{$kitcompid}{kitcompname} }, \%{$kitcomphash{$kitcompid}} ); | ||||
|             if($rc){ | ||||
|                 my %rsp; | ||||
|                 push@{ $rsp{data} }, "Failed to write kitcomponent $kitcomphash{$kitcompid}{kitcompname} xCAT DB"; | ||||
|                 xCAT::MsgUtils->message( "E", \%rsp, $callback ); | ||||
|                 return 1; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         push @kitnames, $kithash{kitname}; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user