Skip to content

Commit 356d569

Browse files
reduce the number of messages for no property file (#1119)
* reduce the number of messages for no property file * refine the messages * fix system test * fix system test
1 parent 6d7bb81 commit 356d569

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,6 @@ def __validate_variable_substitution(self, tokenized_value, model_folder_path):
763763
logger_method = _info_logger.info
764764

765765
variables_file_name = self._model_context.get_variable_file()
766-
if variables_file_name is None:
767-
logger_method('WLSDPLY-05021', model_folder_path, property_name,
768-
class_name=_class_name, method_name=_method_name)
769-
else:
770-
logger_method('WLSDPLY-05022', model_folder_path, property_name, variables_file_name,
771-
class_name=_class_name, method_name=_method_name)
772766

773767
self._logger.exiting(class_name=_class_name, method_name=_method_name, result=untokenized_value)
774768
return untokenized_value

core/src/main/python/wlsdeploy/util/variables.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import os
@@ -260,7 +260,11 @@ def _substitute(text, variables, model_context, error_info, attribute_name=None)
260260
# log, or throw an exception if key is not found.
261261
if key not in variables:
262262
allow_unresolved = validation_config.allow_unresolved_variable_tokens()
263-
_report_token_issue('WLSDPLY-01732', method_name, allow_unresolved, key)
263+
if model_context.get_variable_file() is not None:
264+
_report_token_issue('WLSDPLY-01732', method_name, allow_unresolved, key)
265+
else:
266+
_report_token_issue('WLSDPLY-01734', method_name, allow_unresolved, key)
267+
264268
_increment_error_count(error_info, allow_unresolved)
265269
problem_found = True
266270
continue

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ WLSDPLY-01730=Failed to load variables file {0}: {1}
342342
WLSDPLY-01731=NOT USED
343343
WLSDPLY-01732=Variable "{0}" is not found in properties file
344344
WLSDPLY-01733=Variable file {0} cannot be read: {1}
345+
WLSDPLY-01734=Variable "{0}" is a property and no properties file was provided
345346
WLSDPLY-01735=Assignment in {0} is not formatted as X=Y: {1}
346347
WLSDPLY-01736=Default variable file name {0}
347348
WLSDPLY-01737=Environment variable "{0}" was not found

system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ void test26ValidateModelWithoutVariableFile(TestInfo testInfo) throws Exception
745745
+ " -oracle_home " + mwhome_12213
746746
+ " -model_file " + getSampleModelFile("1");
747747
CommandResult result = Runner.run(cmd, getTestMethodEnvironment(testInfo), out);
748-
verifyErrorMsg(result, ", but no variables file was specified");
748+
verifyErrorMsg(result, " and no properties file was provided");
749749
}
750750
}
751751

0 commit comments

Comments
 (0)