Skip to content

Commit 39945f3

Browse files
committed
Changed code that reports it as a validation error to not have a properties file entry for model values containing a '$[' sequence
1 parent 83d1b8b commit 39945f3

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

core/src/main/python/wlsdeploy/tool/validate/validator.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,7 @@ def __validate_domain_info_section(self, model_section_key, model_dict, validati
362362
# section_dict_value is either the dict of a folder in the
363363
# section, or the value of an attribute in the section
364364
if '${' in section_dict_key:
365-
section_dict_key, validation_result = self.__validate_variable_substitution(section_dict_key,
366-
model_folder_path,
367-
validation_result)
365+
validation_result.add_error('WLSDPLY-05035', model_folder_path, section_dict_key)
368366

369367
self._logger.finer('WLSDPLY-05011', section_dict_key, section_dict_value,
370368
class_name=_class_name, method_name=_method_name)
@@ -536,8 +534,7 @@ def __validate_section_folder(self, model_node, validation_location, validation_
536534
for name in model_node:
537535
expanded_name = name
538536
if '${' in name:
539-
expanded_name, validation_result = \
540-
self.__validate_variable_substitution(name, model_folder_path, validation_result)
537+
_report_unsupported_variable_usage(name, model_folder_path, validation_result)
541538

542539
self._logger.finest('3 expanded_name={0}', expanded_name,
543540
class_name=_class_name, method_name=_method_name)
@@ -830,18 +827,12 @@ def __validate_variable_substitution(self, tokenized_value, model_folder_path, v
830827
# FIXME(mwooten) - the cla_utils should be fixing all windows paths to use forward slashes already...
831828
# assuming that the value is not None
832829
variables_file_name = self._model_context.get_variable_file()
833-
if self._validation_mode == _ValidationModes.STANDALONE:
834-
if variables_file_name is None:
835-
validation_result.add_info('WLSDPLY-05021', model_folder_path, property_name)
836-
else:
837-
validation_result.add_info('WLSDPLY-05022', model_folder_path, property_name,
838-
variables_file_name)
839-
elif self._validation_mode == _ValidationModes.TOOL:
840-
if variables_file_name is None:
841-
validation_result.add_error('WLSDPLY-05021', model_folder_path, property_name)
842-
else:
843-
validation_result.add_error('WLSDPLY-05022', model_folder_path, property_name,
844-
variables_file_name)
830+
if variables_file_name is None:
831+
self._logger.warning('WLSDPLY-05021', model_folder_path, property_name,
832+
class_name=_class_name, method_name=_method_name)
833+
else:
834+
self._logger.warning('WLSDPLY-05022', model_folder_path, property_name, variables_file_name,
835+
class_name=_class_name, method_name=_method_name)
845836

846837
self._logger.exiting(class_name=_class_name, method_name=_method_name, result=untokenized_value)
847838
return untokenized_value, validation_result

0 commit comments

Comments
 (0)