Skip to content

Fix discovery error for custom config #1374

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
Jan 30, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -157,28 +157,39 @@ def _add_custom_configuration_to_archive(self, model_name, model_value, location
temp.append_location(model_constants.COHERENCE_CLUSTER_SYSTEM_RESOURCE)
cluster_name = location.get_name_for_token(self._aliases.get_name_token(temp))
_logger.entering(cluster_name, model_name, model_value, class_name=_class_name, method_name=_method_name)
new_name = model_value
custom_config_path_into_archive = model_value
if model_value is not None:
archive_file = self._model_context.get_archive_file()
file_name_path = model_value
config_path_in_model = model_value
# We need to fix this before further processing.
# coherence convention is coherence/<cluster>/<filename> (if created through console), but if the
# path is set to config/coherence/<cluster>/<filename> seems to work also, so prepend
# with "config/" to make sure the addCoherenceConfigFile working properly when checking for the
# actual file path
if config_path_in_model.startswith("coherence/"):
config_path_in_model = "config/" + config_path_in_model
if not self._model_context.is_remote():
file_name_path = self._convert_path(model_value)
# Get the actual full path
config_path_in_model = self._convert_path(config_path_in_model)
if not self._model_context.skip_archive():
try:
new_name = archive_file.addCoherenceConfigFile(cluster_name, new_name)
_logger.finer('WLSDPLY-06315', file_name_path, class_name=_class_name, method_name=_method_name)
custom_config_path_into_archive = archive_file.addCoherenceConfigFile(cluster_name,
config_path_in_model)
_logger.finer('WLSDPLY-06315', config_path_in_model, class_name=_class_name,
method_name=_method_name)
except (IllegalArgumentException, WLSDeployArchiveIOException), wioe:
_logger.warning('WLSDPLY-06316', cluster_name, file_name_path, wioe.getLocalizedMessage(),
class_name=_class_name, method_name=_method_name)
new_name = None
_logger.warning('WLSDPLY-06316', cluster_name, config_path_in_model,
wioe.getLocalizedMessage(), class_name=_class_name, method_name=_method_name)
custom_config_path_into_archive = None
else:
new_name = WLSDeployArchive.getCoherenceConfigArchivePath(cluster_name, new_name)
self.add_to_remote_map(file_name_path, new_name,
custom_config_path_into_archive = WLSDeployArchive.getCoherenceConfigArchivePath(cluster_name,
custom_config_path_into_archive)
self.add_to_remote_map(config_path_in_model, custom_config_path_into_archive,
WLSDeployArchive.ArchiveEntryType.COHERENCE_CONFIG.name())


_logger.exiting(class_name=_class_name, method_name=_method_name, result=new_name)
return new_name
_logger.exiting(class_name=_class_name, method_name=_method_name, result=custom_config_path_into_archive)
return custom_config_path_into_archive

def _add_cache_config(self, model_name, model_value, location):
"""
Expand Down