Skip to content

Commit af8e7a0

Browse files
authored
Fix discovery error for custom config (#1374)
1 parent ed6b6e1 commit af8e7a0

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

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

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,28 +157,39 @@ def _add_custom_configuration_to_archive(self, model_name, model_value, location
157157
temp.append_location(model_constants.COHERENCE_CLUSTER_SYSTEM_RESOURCE)
158158
cluster_name = location.get_name_for_token(self._aliases.get_name_token(temp))
159159
_logger.entering(cluster_name, model_name, model_value, class_name=_class_name, method_name=_method_name)
160-
new_name = model_value
160+
custom_config_path_into_archive = model_value
161161
if model_value is not None:
162162
archive_file = self._model_context.get_archive_file()
163-
file_name_path = model_value
163+
config_path_in_model = model_value
164+
# We need to fix this before further processing.
165+
# coherence convention is coherence/<cluster>/<filename> (if created through console), but if the
166+
# path is set to config/coherence/<cluster>/<filename> seems to work also, so prepend
167+
# with "config/" to make sure the addCoherenceConfigFile working properly when checking for the
168+
# actual file path
169+
if config_path_in_model.startswith("coherence/"):
170+
config_path_in_model = "config/" + config_path_in_model
164171
if not self._model_context.is_remote():
165-
file_name_path = self._convert_path(model_value)
172+
# Get the actual full path
173+
config_path_in_model = self._convert_path(config_path_in_model)
166174
if not self._model_context.skip_archive():
167175
try:
168-
new_name = archive_file.addCoherenceConfigFile(cluster_name, new_name)
169-
_logger.finer('WLSDPLY-06315', file_name_path, class_name=_class_name, method_name=_method_name)
176+
custom_config_path_into_archive = archive_file.addCoherenceConfigFile(cluster_name,
177+
config_path_in_model)
178+
_logger.finer('WLSDPLY-06315', config_path_in_model, class_name=_class_name,
179+
method_name=_method_name)
170180
except (IllegalArgumentException, WLSDeployArchiveIOException), wioe:
171-
_logger.warning('WLSDPLY-06316', cluster_name, file_name_path, wioe.getLocalizedMessage(),
172-
class_name=_class_name, method_name=_method_name)
173-
new_name = None
181+
_logger.warning('WLSDPLY-06316', cluster_name, config_path_in_model,
182+
wioe.getLocalizedMessage(), class_name=_class_name, method_name=_method_name)
183+
custom_config_path_into_archive = None
174184
else:
175-
new_name = WLSDeployArchive.getCoherenceConfigArchivePath(cluster_name, new_name)
176-
self.add_to_remote_map(file_name_path, new_name,
185+
custom_config_path_into_archive = WLSDeployArchive.getCoherenceConfigArchivePath(cluster_name,
186+
custom_config_path_into_archive)
187+
self.add_to_remote_map(config_path_in_model, custom_config_path_into_archive,
177188
WLSDeployArchive.ArchiveEntryType.COHERENCE_CONFIG.name())
178189

179190

180-
_logger.exiting(class_name=_class_name, method_name=_method_name, result=new_name)
181-
return new_name
191+
_logger.exiting(class_name=_class_name, method_name=_method_name, result=custom_config_path_into_archive)
192+
return custom_config_path_into_archive
182193

183194
def _add_cache_config(self, model_name, model_value, location):
184195
"""

0 commit comments

Comments
 (0)