Skip to content

Commit c5ff114

Browse files
temporary fix to hold on to the code that attempts to fix security configuration in 11g
1 parent f72a841 commit c5ff114

File tree

6 files changed

+130
-450
lines changed

6 files changed

+130
-450
lines changed

core/src/main/python/wlsdeploy/tool/create/creator.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,17 @@ def _create_security_provider_mbeans(self, type_name, model_nodes, base_location
180180
location = LocationContext(base_location).append_location(type_name)
181181
self._process_flattened_folder(location)
182182

183+
# For create, delete the existing nodes, and re-add in order found in model in iterative code below
184+
self._delete_existing_providers(location)
185+
183186
token_name = self.alias_helper.get_name_token(location)
184187
create_path = self.alias_helper.get_wlst_create_path(location)
185188
list_path = self.alias_helper.get_wlst_list_path(location)
186189
existing_folder_names = self._get_existing_folders(list_path)
187190
known_providers = self.alias_helper.get_model_subfolder_names(location)
188191
allow_custom = str(self.alias_helper.is_custom_folder_allowed(location))
189-
190-
# For create, delete the existing nodes, and re-add in order found in model in iterative code below
191-
self._delete_existing_providers(location)
192+
self.logger.finer('create path {0}, list_path {1}, existing folders {2}', create_path, list_path,
193+
str(existing_folder_names))
192194

193195
for model_name in model_nodes:
194196
model_node = model_nodes[model_name]
@@ -477,11 +479,12 @@ def _delete_existing_providers(self, location):
477479
:param location: current context of the location pointing at the provider mbean
478480
"""
479481
_method_name = '_delete_existing_providers'
480-
self.logger.entering(str(location), class_name=self.__class_name, method_name=_method_name)
482+
self.logger.entering(location.get_folder_path(), class_name=self.__class_name, method_name=_method_name)
481483

482484
list_path = self.alias_helper.get_wlst_list_path(location)
485+
self.logger.finer('Look for providers at location {0}', list_path)
483486
existing_folder_names = self._get_existing_folders(list_path)
484-
wlst_base_provider_type, wlst_name = self.alias_helper.get_wlst_mbean_type_and_name(location)
487+
wlst_base_provider_type = self.alias_helper.get_wlst_mbean_type(location)
485488
if len(existing_folder_names) == 0:
486489
self.logger.finer('No default providers installed for {0} at {1}', wlst_base_provider_type, list_path)
487490
else:

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from wlsdeploy.exception import exception_helper
5050
from wlsdeploy.exception.expection_types import ExceptionType
5151
from 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
5353
from wlsdeploy.tool.deploy import model_deployer
5454
from wlsdeploy.tool.util.archive_helper import ArchiveHelper
5555
from 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

core/src/main/python/wlsdeploy/tool/create/domain_typedef.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ def is_system_wldf(self, name):
210210
"""
211211
return self._is_system_name(name, 'wldf')
212212

213-
def configure_security_configuration_is_supported_by_tool(self):
213+
def is_security_configuration_supported(self):
214214
"""
215215
Determine if the security configuration can be configured. Currently, update domain does not
216-
support configuration of any providers within a realm. Potentially safest to not touch security
217-
configuration at all in order to not set values conducive to the realms (like active realm)
216+
support configuration of the SecurityConfiguration, and 11g create domain does not support
217+
configuration of the SecurityConfiguration
218218
219219
:return: True if the security realm can be configured
220220
"""

0 commit comments

Comments
 (0)