@@ -578,7 +578,7 @@ def _add_library(self, server_name, classpath_name):
578578
579579 def _add_keystore_file_to_archive (self , model_name , model_value , location ):
580580 """
581- Add the Server custom trust or identity keystore file to the archive.
581+ Add the custom trust or identity keystore file to the archive.
582582 :param model_name: attribute name in the model
583583 :param model_value: converted model value for the attribute
584584 :param location: context containing the current location information
@@ -591,20 +591,62 @@ def _add_keystore_file_to_archive(self, model_name, model_value, location):
591591 server_name = self ._get_server_name_from_location (location )
592592 archive_file = self ._model_context .get_archive_file ()
593593 file_path = self ._convert_path (model_value )
594- _logger .finer ('WLSDPLY-06623' , file_path , server_name , class_name = _class_name , method_name = _method_name )
595- try :
596- new_name = archive_file .addServerKeyStoreFile (server_name , File (file_path ))
597- except IllegalArgumentException , iae :
598- _logger .warning ('WLSDPLY-06624' , server_name , file_path , iae .getLocalizedMessage (),
599- class_name = _class_name , method_name = _method_name )
600- except WLSDeployArchiveIOException , wioe :
601- de = exception_helper .create_discover_exception ('WLSDPLY-06625' , server_name , file_path ,
602- wioe .getLocalizedMessage ())
603- _logger .throwing (class_name = _class_name , method_name = _method_name , error = de )
604- raise de
594+ if server_name :
595+ new_name = self ._add_server_keystore_file_to_archive (server_name , archive_file , file_path )
596+ else :
597+ new_name = self ._add_node_manager_keystore_file_to_archive (archive_file , file_path )
598+
605599 _logger .exiting (class_name = _class_name , method_name = _method_name , result = new_name )
606600 return new_name
607601
602+ def _add_server_keystore_file_to_archive (self , server_name , archive_file , file_path ):
603+ """
604+ Add the Server custom trust or identity keystore file to the archive.
605+ :param server_name: attribute name in the model
606+ :param archive_file: converted model value for the attribute
607+ :param file_path: context containing the current location information
608+ :return: modified location and name for the model keystore file
609+ """
610+ _method_name = '_add_server_keystore_file_to_archive'
611+ _logger .entering (server_name , archive_file , file_path , class_name = _class_name , method_name = _method_name )
612+ _logger .finer ('WLSDPLY-06623' , file_path , server_name , class_name = _class_name , method_name = _method_name )
613+ new_name = None
614+
615+ try :
616+ new_name = archive_file .addServerKeyStoreFile (server_name , File (file_path ))
617+ except IllegalArgumentException , iae :
618+ _logger .warning ('WLSDPLY-06624' , server_name , file_path , iae .getLocalizedMessage (),
619+ class_name = _class_name , method_name = _method_name )
620+ except WLSDeployArchiveIOException , wioe :
621+ de = exception_helper .create_discover_exception ('WLSDPLY-06625' , server_name , file_path ,
622+ wioe .getLocalizedMessage ())
623+ _logger .throwing (class_name = _class_name , method_name = _method_name , error = de )
624+ raise de
625+ return new_name
626+
627+ def _add_node_manager_keystore_file_to_archive (self , archive_file , file_path ):
628+ """
629+ Add the node manager custom trust or identity keystore file to the archive.
630+ :param archive_file: converted model value for the attribute
631+ :param file_path: context containing the current location information
632+ :return: modified location and name for the model keystore file
633+ """
634+ _method_name = '_add_node_manager_keystore_file_to_archive'
635+ _logger .entering (archive_file , file_path , class_name = _class_name , method_name = _method_name )
636+ _logger .finer ('WLSDPLY-06636' , file_path , class_name = _class_name , method_name = _method_name )
637+ new_name = None
638+
639+ try :
640+ new_name = archive_file .addNodeManagerKeyStoreFile (File (file_path ))
641+ except IllegalArgumentException , iae :
642+ _logger .warning ('WLSDPLY-06637' , file_path , iae .getLocalizedMessage (), class_name = _class_name ,
643+ method_name = _method_name )
644+ except WLSDeployArchiveIOException , wioe :
645+ de = exception_helper .create_discover_exception ('WLSDPLY-06638' , file_path , wioe .getLocalizedMessage ())
646+ _logger .throwing (class_name = _class_name , method_name = _method_name , error = de )
647+ raise de
648+ return new_name
649+
608650 def _get_server_name_from_location (self , location ):
609651 """
610652 Retrieve the server name from the location context file.
0 commit comments