46
46
CommandLineArgUtil .DOMAIN_TYPE_SWITCH , # Used by shell script to locate WLST
47
47
CommandLineArgUtil .MODEL_FILE_SWITCH ,
48
48
CommandLineArgUtil .ARCHIVE_FILE_SWITCH ,
49
- CommandLineArgUtil .PRINT_USAGE_SWITCH ,
50
49
CommandLineArgUtil .VARIABLE_FILE_SWITCH ,
51
50
CommandLineArgUtil .TARGET_VERSION_SWITCH ,
52
51
CommandLineArgUtil .TARGET_MODE_SWITCH ,
53
- CommandLineArgUtil .ATTRIBUTES_ONLY_SWITCH ,
54
- CommandLineArgUtil .FOLDERS_ONLY_SWITCH ,
55
- CommandLineArgUtil .RECURSIVE_SWITCH ,
56
52
CommandLineArgUtil .VALIDATION_METHOD
57
53
]
58
54
@@ -69,7 +65,6 @@ def __process_args(args):
69
65
70
66
__verify_required_args_present (required_arg_map )
71
67
__process_model_args (optional_arg_map )
72
- __process_print_usage_args (optional_arg_map )
73
68
74
69
combined_arg_map = optional_arg_map .copy ()
75
70
combined_arg_map .update (required_arg_map )
@@ -101,63 +96,8 @@ def __process_model_args(optional_arg_map):
101
96
"""
102
97
_method_name = '__process_model_args'
103
98
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
-
108
99
cla_helper .validate_optional_archive (_program_name , optional_arg_map )
109
100
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 )
161
101
return
162
102
163
103
@@ -222,40 +162,29 @@ def main(args):
222
162
cla_helper .clean_up_temp_files ()
223
163
sys .exit (exit_code )
224
164
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 )
256
182
cla_helper .clean_up_temp_files ()
183
+ sys .exit (CommandLineArgUtil .PROG_ERROR_EXIT_CODE )
184
+
185
+ cla_helper .clean_up_temp_files ()
257
186
258
- tool_exit .end (model_context , exit_code )
187
+ tool_exit .end (model_context , exit_code )
259
188
return
260
189
261
190
0 commit comments