4343from wlsdeploy .util import tool_exit
4444from wlsdeploy .util .cla_utils import CommandLineArgUtil
4545from wlsdeploy .util .cla_utils import TOOL_TYPE_CREATE
46+ from wlsdeploy .util .exit_code import ExitCode
4647from wlsdeploy .util .weblogic_helper import WebLogicHelper
4748from wlsdeploy .tool .create import atp_helper
4849from wlsdeploy .tool .create import ssl_helper
@@ -128,7 +129,7 @@ def __process_java_home_arg(optional_arg_map):
128129 try :
129130 java_home = FileUtils .validateExistingDirectory (java_home_name )
130131 except IllegalArgumentException , iae :
131- ex = exception_helper .create_cla_exception (CommandLineArgUtil . ARG_VALIDATION_ERROR_EXIT_CODE ,
132+ ex = exception_helper .create_cla_exception (ExitCode . ARG_VALIDATION_ERROR ,
132133 'WLSDPLY-12400' , _program_name , java_home_name ,
133134 iae .getLocalizedMessage (), error = iae )
134135 __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
@@ -149,7 +150,7 @@ def __process_domain_location_args(optional_arg_map):
149150 has_parent = CommandLineArgUtil .DOMAIN_PARENT_SWITCH in optional_arg_map
150151
151152 if (has_home and has_parent ) or (not has_home and not has_parent ):
152- ex = exception_helper .create_cla_exception (CommandLineArgUtil . USAGE_ERROR_EXIT_CODE ,
153+ ex = exception_helper .create_cla_exception (ExitCode . USAGE_ERROR ,
153154 'WLSDPLY-20025' , _program_name ,
154155 CommandLineArgUtil .DOMAIN_PARENT_SWITCH ,
155156 CommandLineArgUtil .DOMAIN_HOME_SWITCH )
@@ -183,7 +184,7 @@ def __process_rcu_args(optional_arg_map, domain_type, domain_typedef):
183184 try :
184185 password = getcreds .getpass ('WLSDPLY-12403' )
185186 except IOException , ioe :
186- ex = exception_helper .create_cla_exception (CommandLineArgUtil . ARG_VALIDATION_ERROR_EXIT_CODE ,
187+ ex = exception_helper .create_cla_exception (ExitCode . ARG_VALIDATION_ERROR ,
187188 'WLSDPLY-12404' , ioe .getLocalizedMessage (),
188189 error = ioe )
189190 __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
@@ -193,14 +194,14 @@ def __process_rcu_args(optional_arg_map, domain_type, domain_typedef):
193194 try :
194195 password = getcreds .getpass ('WLSDPLY-12405' )
195196 except IOException , ioe :
196- ex = exception_helper .create_cla_exception (CommandLineArgUtil . ARG_VALIDATION_ERROR_EXIT_CODE ,
197+ ex = exception_helper .create_cla_exception (ExitCode . ARG_VALIDATION_ERROR ,
197198 'WLSDPLY-12406' , ioe .getLocalizedMessage (),
198199 error = ioe )
199200 __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
200201 raise ex
201202 optional_arg_map [CommandLineArgUtil .RCU_SCHEMA_PASS_SWITCH ] = String (password )
202203 else :
203- ex = exception_helper .create_cla_exception (CommandLineArgUtil . USAGE_ERROR_EXIT_CODE ,
204+ ex = exception_helper .create_cla_exception (ExitCode . USAGE_ERROR ,
204205 'WLSDPLY-12407' , _program_name ,
205206 CommandLineArgUtil .RCU_DB_SWITCH ,
206207 CommandLineArgUtil .RCU_PREFIX_SWITCH )
@@ -223,7 +224,7 @@ def __process_opss_args(optional_arg_map):
223224 try :
224225 passphrase = getcreds .getpass ('WLSDPLY-20027' )
225226 except IOException , ioe :
226- ex = exception_helper .create_cla_exception (CommandLineArgUtil . ARG_VALIDATION_ERROR_EXIT_CODE ,
227+ ex = exception_helper .create_cla_exception (ExitCode . ARG_VALIDATION_ERROR ,
227228 'WLSDPLY-20028' , ioe .getLocalizedMessage (), error = ioe )
228229 __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
229230 raise ex
@@ -259,15 +260,15 @@ def validate_rcu_args_and_model(model_context, model, archive_helper, aliases):
259260 else :
260261 __logger .severe ('WLSDPLY-12411' , error = None , class_name = _class_name , method_name = _method_name )
261262 cla_helper .clean_up_temp_files ()
262- tool_exit .end (model_context , CommandLineArgUtil . PROG_ERROR_EXIT_CODE )
263+ tool_exit .end (model_context , ExitCode . ERROR )
263264
264265 else :
265266 if model_context .get_domain_typedef ().required_rcu ():
266267 if not model_context .get_rcu_database () or not model_context .get_rcu_prefix ():
267268 __logger .severe ('WLSDPLY-12408' , model_context .get_domain_type (), CommandLineArgUtil .RCU_DB_SWITCH ,
268269 CommandLineArgUtil .RCU_PREFIX_SWITCH )
269270 cla_helper .clean_up_temp_files ()
270- tool_exit .end (model_context , CommandLineArgUtil . PROG_ERROR_EXIT_CODE )
271+ tool_exit .end (model_context , ExitCode . ERROR )
271272
272273 return has_atpdbinfo , has_ssldbinfo
273274
@@ -303,13 +304,13 @@ def main(args):
303304
304305 WlstHelper (ExceptionType .CREATE ).silence ()
305306
306- exit_code = CommandLineArgUtil . PROG_OK_EXIT_CODE
307+ exit_code = ExitCode . OK
307308
308309 try :
309310 model_context = __process_args (args )
310311 except CLAException , ex :
311312 exit_code = ex .getExitCode ()
312- if exit_code != CommandLineArgUtil . HELP_EXIT_CODE :
313+ if exit_code != ExitCode . HELP :
313314 __logger .severe ('WLSDPLY-20008' , _program_name , ex .getLocalizedMessage (), error = ex ,
314315 class_name = _class_name , method_name = _method_name )
315316 cla_helper .clean_up_temp_files ()
@@ -351,25 +352,25 @@ def main(args):
351352 __logger .severe ('WLSDPLY-12409' , _program_name , ex .getLocalizedMessage (), error = ex ,
352353 class_name = _class_name , method_name = _method_name )
353354 cla_helper .clean_up_temp_files ()
354- tool_exit .end (model_context , CommandLineArgUtil . PROG_ERROR_EXIT_CODE )
355+ tool_exit .end (model_context , ExitCode . ERROR )
355356
356357 except CreateException , ex :
357358 __logger .severe ('WLSDPLY-12409' , _program_name , ex .getLocalizedMessage (), error = ex ,
358359 class_name = _class_name , method_name = _method_name )
359360 cla_helper .clean_up_temp_files ()
360- tool_exit .end (model_context , CommandLineArgUtil . PROG_ERROR_EXIT_CODE )
361+ tool_exit .end (model_context , ExitCode . ERROR )
361362
362363 except IOException , ex :
363364 __logger .severe ('WLSDPLY-12409' , _program_name , ex .getLocalizedMessage (), error = ex ,
364365 class_name = _class_name , method_name = _method_name )
365366 cla_helper .clean_up_temp_files ()
366- tool_exit .end (model_context , CommandLineArgUtil . PROG_ERROR_EXIT_CODE )
367+ tool_exit .end (model_context , ExitCode . ERROR )
367368
368369 except DeployException , ex :
369370 __logger .severe ('WLSDPLY-12410' , _program_name , ex .getLocalizedMessage (), error = ex ,
370371 class_name = _class_name , method_name = _method_name )
371372 cla_helper .clean_up_temp_files ()
372- tool_exit .end (model_context , CommandLineArgUtil . PROG_ERROR_EXIT_CODE )
373+ tool_exit .end (model_context , ExitCode . ERROR )
373374
374375 cla_helper .clean_up_temp_files ()
375376
0 commit comments