Skip to content

Commit 42548e0

Browse files
Add code to discover if a top level folder exists in the domain
1 parent c84e8b9 commit 42548e0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,17 @@ def _get_model_name(self, location, wlst_name):
483483
class_name=_class_name, method_name=_method_name)
484484
return model_name
485485

486+
def _topfolder_exists(self, model_top_folder_name):
487+
"""
488+
Check to see if the folder represented by the top folder name exists at the current location.
489+
There is not a way to check for wlst_type for top folders. The top folder name and the wlst name
490+
must be the same.
491+
:param model_top_folder_name: to check for at top directory
492+
:return: True if the folder exists at the current location in the domain
493+
"""
494+
result = self._wlst_helper.lsc('/', log_throwing=False)
495+
return model_top_folder_name in result
496+
486497
def _subfolder_exists(self, model_folder_name, location):
487498
"""
488499
Check to see if the folder represented by the model folder name exists at the current loction

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def _get_nm_properties(self):
353353
model_top_folder_name = model_constants.NM_PROPERTIES
354354
result = OrderedDict()
355355
location = LocationContext(self._base_location)
356-
if self._subfolder_exists(model_top_folder_name, location):
356+
if self._topfolder_exists(model_top_folder_name):
357357
_logger.info('WLSDPLY-06627', class_name=_class_name, method_name=_method_name)
358358
location.append_location(model_top_folder_name)
359359
self._populate_model_parameters(result, location)

0 commit comments

Comments
 (0)