Skip to content

Commit 3a9bc4e

Browse files
committed
JIRA WDT-47 Revised provider location check, removed unused method
1 parent 281db34 commit 3a9bc4e

File tree

4 files changed

+38
-11
lines changed

4 files changed

+38
-11
lines changed

core/src/main/python/wlsdeploy/aliases/aliases.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@ def get_mode_enum(self):
9494
"""
9595
return self._wlst_mode
9696

97-
def get_version(self):
98-
"""
99-
Get the version instance
100-
:return: version of this aliases instance
101-
"""
102-
return self._wls_version
103-
10497
def get_model_top_level_folder_names(self):
10598
"""
10699
Returns a list of the recognized top-level model folders corresponding to the known WLST top-level folders.
@@ -290,6 +283,18 @@ def is_custom_folder_allowed(self, location):
290283
return self._alias_entries.is_location_child_folder_type(location,
291284
ChildFoldersTypes.MULTIPLE_WITH_TYPE_SUBFOLDER)
292285

286+
def is_security_provider_type(self, location):
287+
"""
288+
Returns true if the specified location is a security provider type, such as AuthenticationProvider.
289+
This currently corresponds to all MULTIPLE_WITH_TYPE_SUBFOLDER entries.
290+
This will need to be refined if new custom types are added, or additional distinctions are required.
291+
:param location: the location to be checked
292+
:return: True if the location is a security provider type, False otherwise
293+
:raises: AliasException: if an error occurs while getting the folder for the location
294+
"""
295+
return self._alias_entries.is_location_child_folder_type(location,
296+
ChildFoldersTypes.MULTIPLE_WITH_TYPE_SUBFOLDER)
297+
293298
###########################################################################
294299
# WLST Folder create-related methods #
295300
###########################################################################

core/src/main/python/wlsdeploy/tool/discover/discoverer.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,15 @@ def _inspect_artificial_folder_name(self, folder_name, location):
645645
return self._inspect_security_folder_name(folder_name, location)
646646

647647
def _inspect_security_folder_name(self, folder_name, location):
648-
# This is so clunky. My alias definition change was rejected.
648+
# This is clunky - Some security providers in 11g offline have the name "Provider", and cannot be discovered.
649+
# If found, log and throw an exception here, and the SecurityConfiguration will be omitted from the model.
650+
649651
if (not self._weblogic_helper.is_version_in_12c()) and self._wlst_mode == WlstModes.OFFLINE and \
650-
'SecurityConfiguration' in location.get_folder_path() and 'Provider' == folder_name:
652+
self._alias_helper.is_security_provider_type(location) and 'Provider' == folder_name:
651653
raise exception_helper.create_discover_exception('WLSDPLY-06201', folder_name, location.get_folder_path())
652-
_logger.info('version {0} mode {1} folder {2} provider {3}', not self._weblogic_helper.is_version_in_12c(),
653-
self._wlst_mode == WlstModes.OFFLINE, 'SecurityConfiguration' in location.get_folder_path(),
654+
655+
_logger.fine('version {0} mode {1} type? {2} provider {3}', not self._weblogic_helper.is_version_in_12c(),
656+
self._wlst_mode == WlstModes.OFFLINE, self._alias_helper.is_security_provider_type(location),
654657
'Provider' == folder_name)
655658
return folder_name
656659

core/src/main/python/wlsdeploy/tool/util/alias_helper.py

+18
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,24 @@ def is_custom_folder_allowed(self, location):
293293
raise ex
294294
return result
295295

296+
def is_security_provider_type(self, location):
297+
"""
298+
Returns true if the specified location is a security provider type.
299+
:param location: the location to be checked
300+
:return: True, if the location is a security provider type, False otherwise
301+
:raises: BundleAwareException of the specified type: if an error occurs
302+
"""
303+
_method_name = 'is_security_provider_type'
304+
305+
try:
306+
result = self.__aliases.is_security_provider_type(location)
307+
except AliasException, ae:
308+
ex = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-19036', str(location),
309+
ae.getLocalizedMessage(), error=ae)
310+
self.__logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
311+
raise ex
312+
return result
313+
296314
def get_wlst_mbean_name(self, location):
297315
"""
298316
Get the MBean name to use to create it for the specified location.

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

+1
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ WLSDPLY-19033=Failed to determine if location ({0}) is version valid, or not
11191119
WLSDPLY-19034=Failed to get the model attribute list that require a special processing via a method for model \
11201120
folder ({0}) at location ({1}): {2}
11211121
WLSDPLY-19035=Failed to determine if the location ({0}) allows custom folder types: {1}
1122+
WLSDPLY-19036=Failed to determine if the location ({0}) is a security provider: {1}
11221123

11231124
# wlsdeploy/tool/util/wlst_helper.py
11241125
WLSDPLY-19100=Failed to change to the WLST directory {0}: {1}

0 commit comments

Comments
 (0)