4646 CommandLineArgUtil .DOMAIN_TYPE_SWITCH , # Used by shell script to locate WLST
4747 CommandLineArgUtil .MODEL_FILE_SWITCH ,
4848 CommandLineArgUtil .ARCHIVE_FILE_SWITCH ,
49- CommandLineArgUtil .PRINT_USAGE_SWITCH ,
5049 CommandLineArgUtil .VARIABLE_FILE_SWITCH ,
5150 CommandLineArgUtil .TARGET_VERSION_SWITCH ,
5251 CommandLineArgUtil .TARGET_MODE_SWITCH ,
53- CommandLineArgUtil .ATTRIBUTES_ONLY_SWITCH ,
54- CommandLineArgUtil .FOLDERS_ONLY_SWITCH ,
55- CommandLineArgUtil .RECURSIVE_SWITCH ,
5652 CommandLineArgUtil .VALIDATION_METHOD
5753]
5854
@@ -69,7 +65,6 @@ def __process_args(args):
6965
7066 __verify_required_args_present (required_arg_map )
7167 __process_model_args (optional_arg_map )
72- __process_print_usage_args (optional_arg_map )
7368
7469 combined_arg_map = optional_arg_map .copy ()
7570 combined_arg_map .update (required_arg_map )
@@ -101,63 +96,8 @@ def __process_model_args(optional_arg_map):
10196 """
10297 _method_name = '__process_model_args'
10398
104- if CommandLineArgUtil .PRINT_USAGE_SWITCH in optional_arg_map :
105- # nothing to do since we are printing help information rather than validating supplied artifacts...
106- return
107-
10899 cla_helper .validate_optional_archive (_program_name , optional_arg_map )
109100 cla_helper .validate_model_present (_program_name , optional_arg_map )
110-
111- something_to_validate = False
112- if CommandLineArgUtil .MODEL_FILE_SWITCH in optional_arg_map :
113- something_to_validate = True
114-
115- if not something_to_validate :
116- ex = exception_helper .create_cla_exception ('WLSDPLY-05400' , _program_name ,
117- CommandLineArgUtil .PRINT_USAGE_SWITCH ,
118- CommandLineArgUtil .MODEL_FILE_SWITCH ,
119- CommandLineArgUtil .ARCHIVE_FILE_SWITCH )
120- __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
121- raise ex
122- return
123-
124-
125- def __process_print_usage_args (optional_arg_map ):
126- """
127- Validate the -print_usage related arguments.
128- :param optional_arg_map: the optional argument map
129- :raises: CLAException: if the arguments are not valid
130- """
131- _method_name = '__process_print_usage_args'
132-
133- if CommandLineArgUtil .PRINT_USAGE_SWITCH in optional_arg_map :
134- print_usage_path = optional_arg_map [CommandLineArgUtil .PRINT_USAGE_SWITCH ]
135- found_controller_arg = None
136- if CommandLineArgUtil .ATTRIBUTES_ONLY_SWITCH in optional_arg_map :
137- found_controller_arg = CommandLineArgUtil .ATTRIBUTES_ONLY_SWITCH
138-
139- if CommandLineArgUtil .FOLDERS_ONLY_SWITCH in optional_arg_map :
140- if found_controller_arg is None :
141- found_controller_arg = CommandLineArgUtil .FOLDERS_ONLY_SWITCH
142- else :
143- ex = exception_helper .create_cla_exception ('WLSDPLY-05401' , _program_name ,
144- CommandLineArgUtil .PRINT_USAGE_SWITCH ,
145- CommandLineArgUtil .FOLDERS_ONLY_SWITCH , found_controller_arg )
146- __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
147- raise ex
148-
149- if CommandLineArgUtil .RECURSIVE_SWITCH in optional_arg_map :
150- if found_controller_arg is None :
151- found_controller_arg = CommandLineArgUtil .RECURSIVE_SWITCH
152- else :
153- ex = exception_helper .create_cla_exception ('WLSDPLY-05401' , _program_name ,
154- CommandLineArgUtil .PRINT_USAGE_SWITCH ,
155- CommandLineArgUtil .RECURSIVE_SWITCH , found_controller_arg )
156- __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
157- raise ex
158- if found_controller_arg is not None :
159- __logger .fine ('WLSDPLY-05402' , _program_name , CommandLineArgUtil .PRINT_USAGE_SWITCH , print_usage_path ,
160- found_controller_arg , class_name = _class_name , method_name = _method_name )
161101 return
162102
163103
@@ -222,40 +162,29 @@ def main(args):
222162 cla_helper .clean_up_temp_files ()
223163 sys .exit (exit_code )
224164
225- print_usage = model_context .get_print_usage ()
226-
227- if print_usage is not None :
228- try :
229- model_validator = Validator (model_context , logger = __logger )
230- model_validator .print_usage (print_usage )
231- except ValidateException , ve :
232- __logger .severe ('WLSDPLY-05404' , _program_name , ve .getLocalizedMessage (), error = ve ,
233- class_name = _class_name , method_name = _method_name )
234- sys .exit (CommandLineArgUtil .PROG_ERROR_EXIT_CODE )
235- else :
236- try :
237- model_file_name = model_context .get_model_file ()
238-
239- if model_file_name is not None :
240- __perform_model_file_validation (model_file_name , model_context )
241-
242- summary_handler = SummaryHandler .findInstance ()
243- if summary_handler is not None :
244- summary_level = summary_handler .getMaximumMessageLevel ()
245- if summary_level == Level .SEVERE :
246- exit_code = CommandLineArgUtil .PROG_ERROR_EXIT_CODE
247- elif summary_level == Level .WARNING :
248- exit_code = CommandLineArgUtil .PROG_WARNING_EXIT_CODE
249-
250- except ValidateException , ve :
251- __logger .severe ('WLSDPLY-20000' , _program_name , ve .getLocalizedMessage (), error = ve ,
252- class_name = _class_name , method_name = _method_name )
253- cla_helper .clean_up_temp_files ()
254- sys .exit (CommandLineArgUtil .PROG_ERROR_EXIT_CODE )
255-
165+ try :
166+ model_file_name = model_context .get_model_file ()
167+
168+ if model_file_name is not None :
169+ __perform_model_file_validation (model_file_name , model_context )
170+
171+ summary_handler = SummaryHandler .findInstance ()
172+ if summary_handler is not None :
173+ summary_level = summary_handler .getMaximumMessageLevel ()
174+ if summary_level == Level .SEVERE :
175+ exit_code = CommandLineArgUtil .PROG_ERROR_EXIT_CODE
176+ elif summary_level == Level .WARNING :
177+ exit_code = CommandLineArgUtil .PROG_WARNING_EXIT_CODE
178+
179+ except ValidateException , ve :
180+ __logger .severe ('WLSDPLY-20000' , _program_name , ve .getLocalizedMessage (), error = ve ,
181+ class_name = _class_name , method_name = _method_name )
256182 cla_helper .clean_up_temp_files ()
183+ sys .exit (CommandLineArgUtil .PROG_ERROR_EXIT_CODE )
184+
185+ cla_helper .clean_up_temp_files ()
257186
258- tool_exit .end (model_context , exit_code )
187+ tool_exit .end (model_context , exit_code )
259188 return
260189
261190
0 commit comments