Skip to content

Commit 25d253c

Browse files
rakillenddsharpe
authored andcommitted
Issue #426 - Return warning or error exit codes if problems are found (#427)
1 parent 0d8ad8c commit 25d253c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

core/src/main/python/validate.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def __perform_model_file_validation(model_file_name, model_context):
195195
validation_results.print_details()
196196

197197
__logger.exiting(class_name=_class_name, method_name=_method_name)
198+
return validation_results
198199

199200

200201
def main(args):
@@ -237,8 +238,14 @@ def main(args):
237238
model_file_name = model_context.get_model_file()
238239

239240
if model_file_name is not None:
240-
__perform_model_file_validation(model_file_name,
241-
model_context)
241+
validation_results = __perform_model_file_validation(model_file_name, model_context)
242+
243+
if validation_results.get_errors_count() > 0:
244+
cla_helper.clean_up_temp_files()
245+
sys.exit(CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
246+
elif validation_results.get_warnings_count() > 0:
247+
cla_helper.clean_up_temp_files()
248+
sys.exit(CommandLineArgUtil.PROG_WARNING_EXIT_CODE)
242249

243250
except ValidateException, ve:
244251
__logger.severe('WLSDPLY-20000', _program_name, ve.getLocalizedMessage(), error=ve,

0 commit comments

Comments
 (0)