Skip to content

Commit 0b77a28

Browse files
committed
JIRA WDT-47 Use single, unpredictable behavior for SecurityConfiguration folder
1 parent 810efdb commit 0b77a28

File tree

4 files changed

+58
-53
lines changed

4 files changed

+58
-53
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
from oracle.weblogic.deploy.util import WLSDeployArchive
77

88
from wlsdeploy.aliases.location_context import LocationContext
9-
from wlsdeploy.aliases.model_constants import SECURITY_CONFIGURATION
109
from wlsdeploy.aliases.validation_codes import ValidationCodes
1110
from wlsdeploy.exception import exception_helper
1211
from wlsdeploy.exception.expection_types import ExceptionType
1312
from wlsdeploy.logging.platform_logger import PlatformLogger
13+
from wlsdeploy.tool.deploy import deployer_utils
1414
from wlsdeploy.tool.util.alias_helper import AliasHelper
1515
from wlsdeploy.tool.util.attribute_setter import AttributeSetter
1616
from wlsdeploy.tool.util.custom_folder_helper import CustomFolderHelper
@@ -134,6 +134,11 @@ def _create_mbean(self, type_name, model_nodes, base_location, log_created=False
134134

135135
token_name = self.alias_helper.get_name_token(location)
136136
if token_name is not None:
137+
if self.alias_helper.requires_unpredictable_single_name_handling(location):
138+
existing_subfolder_names = deployer_utils.get_existing_object_list(location, self.alias_helper)
139+
if len(existing_subfolder_names) > 0:
140+
mbean_name = existing_subfolder_names[0]
141+
137142
location.add_name_token(token_name, mbean_name)
138143

139144
self._process_flattened_folder(location)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
from wlsdeploy.exception.expection_types import ExceptionType
5151
from wlsdeploy.tool.create.creator import Creator
5252
from wlsdeploy.tool.create.security_provider_creator import SecurityProviderCreator
53+
from wlsdeploy.tool.deploy import deployer_utils
5354
from wlsdeploy.tool.deploy import model_deployer
5455
from wlsdeploy.tool.util.archive_helper import ArchiveHelper
5556
from wlsdeploy.tool.util.library_helper import LibraryHelper
@@ -853,7 +854,7 @@ def _configure_security_configuration(self):
853854
# SecurityConfiguration is special since the subfolder name does not change when you change the domain name.
854855
# It only changes once the domain is written and re-read...
855856
location = LocationContext()
856-
domain_name_token = self.alias_helper.get_name_token(location)
857+
domain_name_token = deployer_utils.get_domain_token(self.alias_helper)
857858
security_config_location = LocationContext().add_name_token(domain_name_token, self._domain_name)
858859
self.security_provider_creator.create_security_configuration(security_config_location)
859860
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)

core/src/main/python/wlsdeploy/tool/deploy/deployer_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
from wlsdeploy.aliases.model_constants import RESOURCE_GROUP
2222
from wlsdeploy.aliases.model_constants import RESOURCE_GROUP_TEMPLATE
23-
from wlsdeploy.aliases.model_constants import SECURITY_CONFIGURATION
2423

2524
_class_name = "deployer_utils"
2625
_logger = platform_logger.PlatformLogger('wlsdeploy.deploy.utils')
@@ -157,9 +156,7 @@ def get_domain_token(alias_helper):
157156
Returns the domain token required by some root-level WLST elements.
158157
:return: the domain token
159158
"""
160-
# determine the domain token by checking security configuration
161-
security_location = LocationContext().append_location(SECURITY_CONFIGURATION)
162-
return alias_helper.get_name_token(security_location)
159+
return "DOMAIN"
163160

164161

165162
def is_in_resource_group_or_template(location):

0 commit comments

Comments
 (0)