27
27
# imports from local packages start here
28
28
from wlsdeploy .aliases .aliases import Aliases
29
29
from wlsdeploy .aliases import model_constants
30
- from wlsdeploy .aliases .model_constants import DEFAULT_WLS_DOMAIN_NAME
30
+ from wlsdeploy .aliases .model_constants import DEFAULT_WLS_DOMAIN_NAME , PATH_TO_RCU_ADMIN_PASSWORD , \
31
+ PATH_TO_RCU_SCHEMA_PASSWORD
31
32
from wlsdeploy .aliases .model_constants import DOMAIN_NAME
32
33
from wlsdeploy .aliases .model_constants import PATH_TO_RCU_DB_CONN
33
34
from wlsdeploy .aliases .model_constants import PATH_TO_RCU_PREFIX
47
48
from wlsdeploy .util import dictionary_utils
48
49
from wlsdeploy .util import env_helper
49
50
from wlsdeploy .util import getcreds
51
+ from wlsdeploy .util import string_utils
50
52
from wlsdeploy .util import tool_main
51
53
from wlsdeploy .util .cla_utils import CommandLineArgUtil
52
54
from wlsdeploy .util .cla_utils import TOOL_TYPE_CREATE
@@ -204,22 +206,44 @@ def validate_rcu_args_and_model(model_context, model, archive_helper, aliases):
204
206
205
207
domain_info = dictionary_utils .get_dictionary_element (model , model_constants .DOMAIN_INFO )
206
208
207
- if model_constants .RCU_DB_INFO in domain_info :
208
- rcu_info = domain_info [model_constants .RCU_DB_INFO ]
209
- rcu_db_info = RcuDbInfo (model_context , aliases , rcu_info )
210
- has_tns_admin = rcu_db_info .has_tns_admin ()
211
- is_regular_db = rcu_db_info .is_regular_db ()
212
- has_atpdbinfo = rcu_db_info .has_atpdbinfo ()
213
- has_ssldbinfo = rcu_db_info .has_ssldbinfo ()
214
-
215
- _validate_atp_wallet_in_archive (archive_helper , is_regular_db , has_tns_admin , model )
216
- elif model_context .get_domain_typedef ().requires_rcu ():
217
- __logger .severe ('WLSDPLY-12408' , model_context .get_domain_type (), PATH_TO_RCU_DB_CONN ,
218
- PATH_TO_RCU_PREFIX , class_name = _class_name , method_name = _method_name )
219
- ex = exception_helper .create_create_exception ('WLSDPLY-12408' , model_context .get_domain_type (),
220
- PATH_TO_RCU_DB_CONN , PATH_TO_RCU_PREFIX )
221
- __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
222
- raise ex
209
+ if model_context .get_domain_typedef ().requires_rcu ():
210
+ if model_constants .RCU_DB_INFO in domain_info :
211
+ rcu_info = domain_info [model_constants .RCU_DB_INFO ]
212
+ rcu_db_info = RcuDbInfo (model_context , aliases , rcu_info )
213
+
214
+ if string_utils .is_empty (rcu_db_info .get_rcu_prefix ()):
215
+ ex = exception_helper .create_validate_exception ('WLSDPLY-12414' , model_context .get_domain_type (),
216
+ PATH_TO_RCU_PREFIX )
217
+ __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
218
+ raise ex
219
+ #
220
+ # Skip validating rcu_db_conn since is there is a tnsnames.ora file,
221
+ # the connection string is picked up from there.
222
+ #
223
+ if string_utils .is_empty (rcu_db_info .get_rcu_schema_password ()):
224
+ ex = exception_helper .create_validate_exception ('WLSDPLY-12414' , model_context .get_domain_type (),
225
+ PATH_TO_RCU_SCHEMA_PASSWORD )
226
+ __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
227
+ raise ex
228
+
229
+ if model_context .is_run_rcu () and string_utils .is_empty (rcu_db_info .get_rcu_admin_password ()):
230
+ ex = exception_helper .create_validate_exception ('WLSDPLY-12415' , model_context .get_domain_type (),
231
+ CommandLineArgUtil .RUN_RCU_SWITCH , PATH_TO_RCU_ADMIN_PASSWORD )
232
+ __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
233
+ raise ex
234
+
235
+ has_tns_admin = rcu_db_info .has_tns_admin ()
236
+ is_regular_db = rcu_db_info .is_regular_db ()
237
+ has_atpdbinfo = rcu_db_info .has_atpdbinfo ()
238
+ has_ssldbinfo = rcu_db_info .has_ssldbinfo ()
239
+
240
+ _validate_atp_wallet_in_archive (archive_helper , is_regular_db , has_tns_admin , model )
241
+ else :
242
+ ex = exception_helper .create_validate_exception ('WLSDPLY-12408' , model_context .get_domain_type (),
243
+ PATH_TO_RCU_DB_CONN , PATH_TO_RCU_PREFIX ,
244
+ PATH_TO_RCU_ADMIN_PASSWORD , PATH_TO_RCU_SCHEMA_PASSWORD )
245
+ __logger .throwing (ex , class_name = _class_name , method_name = _method_name )
246
+ raise ex
223
247
224
248
return has_atpdbinfo , has_ssldbinfo
225
249
@@ -237,8 +261,7 @@ def _validate_atp_wallet_in_archive(archive_helper, is_regular_db, has_tns_admin
237
261
model [model_constants .DOMAIN_INFO ][model_constants .RCU_DB_INFO ][
238
262
model_constants .DRIVER_PARAMS_NET_TNS_ADMIN ] = wallet_path
239
263
else :
240
- __logger .severe ('WLSDPLY-12411' , class_name = _class_name , method_name = _method_name )
241
- ex = exception_helper .create_create_exception ('WLSDPLY-12411' )
264
+ ex = exception_helper .create_validate_exception ('WLSDPLY-12411' )
242
265
__logger .throwing (ex , class_name = _class_name , method_name = _method_name )
243
266
raise ex
244
267
0 commit comments