Skip to content

Add code to discover if a top level folder exists in the domain #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions core/src/main/python/wlsdeploy/tool/discover/discoverer.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,17 @@ def _get_model_name(self, location, wlst_name):
class_name=_class_name, method_name=_method_name)
return model_name

def _topfolder_exists(self, model_top_folder_name):
"""
Check to see if the folder represented by the top folder name exists at the current location.
There is not a way to check for wlst_type for top folders. The top folder name and the wlst name
must be the same.
:param model_top_folder_name: to check for at top directory
:return: True if the folder exists at the current location in the domain
"""
result = self._wlst_helper.lsc('/', log_throwing=False)
return model_top_folder_name in result

def _subfolder_exists(self, model_folder_name, location):
"""
Check to see if the folder represented by the model folder name exists at the current loction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def _get_nm_properties(self):
model_top_folder_name = model_constants.NM_PROPERTIES
result = OrderedDict()
location = LocationContext(self._base_location)
if self._subfolder_exists(model_top_folder_name, location):
if self._topfolder_exists(model_top_folder_name):
_logger.info('WLSDPLY-06627', class_name=_class_name, method_name=_method_name)
location.append_location(model_top_folder_name)
self._populate_model_parameters(result, location)
Expand Down