4949from wlsdeploy .exception import exception_helper
5050from wlsdeploy .exception .expection_types import ExceptionType
5151from wlsdeploy .tool .create .creator import Creator
52- from wlsdeploy .tool .create .security_provider_handler import SecurityProviderHandler
52+ from wlsdeploy .tool .create .security_provider_creator import SecurityProviderCreator
5353from wlsdeploy .tool .deploy import model_deployer
5454from wlsdeploy .tool .util .archive_helper import ArchiveHelper
5555from wlsdeploy .tool .util .library_helper import LibraryHelper
@@ -80,7 +80,7 @@ def __init__(self, model_dictionary, model_context, aliases):
8080 raise ex
8181
8282 self .topology_helper = TopologyHelper (self .aliases , ExceptionType .CREATE , self .logger )
83- self .security_provider_creator = SecurityProviderHandler (model_dictionary , model_context , aliases ,
83+ self .security_provider_creator = SecurityProviderCreator (model_dictionary , model_context , aliases ,
8484 ExceptionType .CREATE , self .logger )
8585
8686 self ._domain_typedef = self .model_context .get_domain_typedef ()
@@ -248,13 +248,6 @@ def __create_domain(self):
248248 self .__create_base_domain (self ._domain_home )
249249 self .__extend_domain (self ._domain_home )
250250
251- # SecurityConfiguration is special since the subfolder name does not change when you change the domain name.
252- # It only changes once the domain is written and re-read...
253- location = LocationContext ()
254- domain_name_token = self .alias_helper .get_name_token (location )
255- security_config_location = LocationContext ().add_name_token (domain_name_token , self ._domain_name )
256- self .security_provider_creator .create_security_configuration (security_config_location )
257-
258251 if len (self .files_to_extract_from_archive ) > 0 :
259252 for file_to_extract in self .files_to_extract_from_archive :
260253 self .archive_helper .extract_file (file_to_extract )
@@ -272,6 +265,7 @@ def __deploy(self):
272265 self .model_context .set_domain_home (self ._domain_home )
273266 self .wlst_helper .read_domain (self ._domain_home )
274267 self .__set_domain_attributes ()
268+ self ._configure_security_configuration ()
275269 self .__deploy_resources_and_apps ()
276270 self .wlst_helper .update_domain ()
277271 self .wlst_helper .close_domain ()
@@ -835,8 +829,7 @@ def __set_admin_server_name(self):
835829
836830 def __set_domain_attributes (self ):
837831 """
838- Set the Domain attributes, which are in the top folder
839- :param location: current location context
832+ Set the Domain attributes
840833 """
841834 _method_name = '__set_domain_attributes'
842835 self .logger .finer ('WLSDPLY-12231' , self ._domain_name , class_name = self .__class_name , method_name = _method_name )
@@ -848,3 +841,20 @@ def __set_domain_attributes(self):
848841 self .wlst_helper .cd (attribute_path )
849842 self ._set_attributes (location , attrib_dict )
850843 return
844+
845+ def _configure_security_configuration (self ):
846+ """
847+ Configure the SecurityConfiguration MBean and its Realm sub-folder. In 11g, the SecurityConfiguration MBean
848+ is not persisted to the domain config until the domain is first written.
849+ :return:
850+ """
851+ _method_name = '_configure_security_configuration'
852+ self .logger .entering (class_name = self .__class_name , method_name = _method_name )
853+ # SecurityConfiguration is special since the subfolder name does not change when you change the domain name.
854+ # It only changes once the domain is written and re-read...
855+ location = LocationContext ()
856+ domain_name_token = self .alias_helper .get_name_token (location )
857+ security_config_location = LocationContext ().add_name_token (domain_name_token , self ._domain_name )
858+ self .security_provider_creator .create_security_configuration (security_config_location )
859+ self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
860+ return
0 commit comments