31
31
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTOREPWD_PROPERTY
32
32
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY
33
33
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_SSL_VERSION
34
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_SSL_VERSION_VALUE
34
35
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_TNS_ADMIN
35
36
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_FAN_ENABLED
36
37
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_PROPERTY_VALUE
@@ -272,6 +273,11 @@ def __run_rcu(self):
272
273
rcu_sys_pass = rcu_db_info .get_preferred_sys_pass ()
273
274
rcu_schema_pass = rcu_db_info .get_preferred_schema_pass ()
274
275
276
+ database_type = rcu_db_info .get_database_type ()
277
+ if database_type is not None and database_type not in ['SSL' , 'ATP' , 'ORACLE' ]:
278
+ ex = exception_helper .create_create_exception ('WLSDPLY-12573' , database_type )
279
+ raise ex
280
+
275
281
if rcu_db_info .is_use_atp ():
276
282
# ATP database, build runner map from RCUDbInfo in the model.
277
283
@@ -298,7 +304,7 @@ def __run_rcu(self):
298
304
299
305
# hard coding for now, may need to expose it if ATP access changed later
300
306
ssl_conn_properties [DRIVER_PARAMS_NET_FAN_ENABLED ] = 'false'
301
- ssl_conn_properties [DRIVER_PARAMS_NET_SSL_VERSION ] = '1.2'
307
+ ssl_conn_properties [DRIVER_PARAMS_NET_SSL_VERSION ] = DRIVER_PARAMS_NET_SSL_VERSION_VALUE
302
308
ssl_conn_properties [DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY ] = 'false'
303
309
304
310
# reset these to pick up any defaults from rcu_db_info
@@ -337,6 +343,11 @@ def __run_rcu(self):
337
343
else :
338
344
# Non-ATP database, use DB config from the command line or RCUDbInfo in the model.
339
345
rcu_db = rcu_db_info .get_preferred_db ()
346
+
347
+ if rcu_db is None :
348
+ ex = exception_helper .create_create_exception ('WLSDPLY-12572' )
349
+ raise ex
350
+
340
351
rcu_db_user = rcu_db_info .get_preferred_db_user ()
341
352
342
353
runner = RCURunner .createRunner (domain_type , oracle_home , java_home , rcu_db , rcu_prefix , rcu_schemas ,
@@ -364,6 +375,19 @@ def _set_rcu_ssl_args_properties(self, ssl_conn_properties, rcu_db_info, keystor
364
375
ssl_conn_properties [DRIVER_PARAMS_KEYSTORE_PROPERTY ] = self .__get_store_path (rcu_db_info .get_tns_admin (),
365
376
keystore )
366
377
378
+ if not os .path .exists (ssl_conn_properties [DRIVER_PARAMS_KEYSTORE_PROPERTY ]):
379
+ ex = exception_helper .create_create_exception ('WLSDPLY-12574' ,
380
+ ssl_conn_properties [DRIVER_PARAMS_KEYSTORE_PROPERTY ],
381
+ DRIVER_PARAMS_KEYSTORE_PROPERTY )
382
+ raise ex
383
+
384
+ if not os .path .exists (ssl_conn_properties [DRIVER_PARAMS_TRUSTSTORE_PROPERTY ]):
385
+ ex = exception_helper .create_create_exception ('WLSDPLY-12574' ,
386
+ ssl_conn_properties [DRIVER_PARAMS_TRUSTSTORE_PROPERTY ],
387
+ DRIVER_PARAMS_TRUSTSTORE_PROPERTY )
388
+ raise ex
389
+
390
+
367
391
def __fail_mt_1221_domain_creation (self ):
368
392
"""
369
393
Abort create if domain contains MT artifacts that cannot be created in the version of WLST offline being used
@@ -974,6 +998,10 @@ def __create_other_domain_artifacts(self, location, mbean_type_list):
974
998
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
975
999
return
976
1000
1001
+ def __set_connection_property_info (self , root_location , property_name , property_value , info_bucket , encrypted = False ):
1002
+ p = self .__set_connection_property (root_location , property_name , property_value , encrypted )
1003
+ info_bucket .append (p )
1004
+
977
1005
def __set_connection_property (self , root_location , property_name , property_value , encrypted = False ):
978
1006
create_path = self .aliases .get_wlst_create_path (root_location )
979
1007
@@ -1004,6 +1032,10 @@ def __set_connection_property(self, root_location, property_name, property_value
1004
1032
self .wlst_helper .set (wlst_name , wlst_value )
1005
1033
1006
1034
root_location .remove_name_token (property_name )
1035
+ if encrypted :
1036
+ return {property_name : '******' }
1037
+ else :
1038
+ return {property_name : property_value }
1007
1039
1008
1040
def __validate_and_get_atp_rcudbinfo (self , rcu_db_info , check_admin_pwd = False ):
1009
1041
"""
@@ -1192,17 +1224,20 @@ def __set_rcu_datasource_parameters_without_shadow_table(self, rcu_db_info):
1192
1224
for ds_name in ds_names :
1193
1225
1194
1226
# Set the driver params
1195
- self .__set_datasource_url (ds_name , fmw_database )
1227
+ actual_url = self .__set_datasource_url (ds_name , fmw_database )
1196
1228
self .__set_datasource_password (ds_name , rcu_schema_pwd )
1197
- self .__reset_datasource_template_userid (ds_name , rcu_prefix )
1198
-
1229
+ actual_schema = self .__reset_datasource_template_userid (ds_name , rcu_prefix )
1230
+ pset = None
1199
1231
if is_atp_ds :
1200
- self .__set_atp_standard_conn_properties (ds_name , tns_admin , truststore , truststore_pwd , truststore_type ,
1232
+ pset = self .__set_atp_standard_conn_properties (ds_name , tns_admin , truststore , truststore_pwd , truststore_type ,
1201
1233
keystore_pwd , keystore_type , keystore )
1202
1234
elif is_ssl_ds :
1203
- self .__set_ssl_standard_conn_properties (ds_name , tns_admin , truststore , truststore_pwd , truststore_type ,
1235
+ pset = self .__set_ssl_standard_conn_properties (ds_name , tns_admin , truststore , truststore_pwd , truststore_type ,
1204
1236
keystore_pwd , keystore_type , keystore )
1205
1237
1238
+ self .logger .info ('WLSDPLY_12575' , ds_name , actual_url , actual_schema , pset ,
1239
+ class_name = self .__class_name , method_name = _method_name )
1240
+
1206
1241
def __reset_datasource_template_userid (self , datasource_name , rcu_prefix ):
1207
1242
location = deployer_utils .get_jdbc_driver_params_location (datasource_name , self .aliases )
1208
1243
location .append_location (JDBC_DRIVER_PARAMS_PROPERTIES )
@@ -1219,6 +1254,7 @@ def __reset_datasource_template_userid(self, datasource_name, rcu_prefix):
1219
1254
self .aliases .get_wlst_attribute_name_and_value (location , DRIVER_PARAMS_PROPERTY_VALUE ,
1220
1255
schema_user )
1221
1256
self .wlst_helper .set_if_needed (wlst_name , wlst_value )
1257
+ return wlst_value
1222
1258
1223
1259
def __set_datasource_password (self , datasource_name , rcu_schema_pwd ):
1224
1260
location = deployer_utils .get_jdbc_driver_params_location (datasource_name , self .aliases )
@@ -1236,6 +1272,7 @@ def __set_datasource_url(self, datasource_name, url_string):
1236
1272
wlst_name , wlst_value = \
1237
1273
self .aliases .get_wlst_attribute_name_and_value (location , URL , url )
1238
1274
self .wlst_helper .set_if_needed (wlst_name , wlst_value )
1275
+ return wlst_value
1239
1276
1240
1277
def __get_store_path (self , tns_admin , store ):
1241
1278
result = store
@@ -1247,52 +1284,63 @@ def __get_store_path(self, tns_admin, store):
1247
1284
def __set_ssl_standard_conn_properties (self , datasource_name , tns_admin , truststore , truststore_pwd ,
1248
1285
truststore_type , keystore_pwd , keystore_type , keystore ):
1249
1286
location = deployer_utils .get_jdbc_driver_params_properties_location (datasource_name , self .aliases )
1287
+ properties_set = []
1250
1288
1251
1289
# Should always have trust store
1252
- self .__set_connection_property (location , DRIVER_PARAMS_TRUSTSTORE_PROPERTY ,
1253
- self .__get_store_path (tns_admin , truststore ))
1290
+ self .__set_connection_property_info (location , DRIVER_PARAMS_TRUSTSTORE_PROPERTY ,
1291
+ self .__get_store_path (tns_admin , truststore ), properties_set )
1254
1292
1255
- self .__set_connection_property (location , DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY ,
1256
- truststore_type )
1293
+ self .__set_connection_property_info (location , DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY ,
1294
+ truststore_type , properties_set )
1257
1295
1258
1296
# if not sso type then user must provide pwd
1259
1297
if truststore_pwd is not None and truststore_pwd != 'None' :
1260
- self .__set_connection_property (location , DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY , truststore_pwd ,
1261
- encrypted = True )
1298
+ self .__set_connection_property_info (location , DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY , truststore_pwd ,
1299
+ properties_set , encrypted = True )
1262
1300
1263
1301
if keystore_pwd is not None and keystore_pwd != 'None' :
1264
- self .__set_connection_property (location , DRIVER_PARAMS_KEYSTOREPWD_PROPERTY , keystore_pwd , encrypted = True )
1302
+ self .__set_connection_property_info (location , DRIVER_PARAMS_KEYSTOREPWD_PROPERTY , keystore_pwd ,
1303
+ properties_set , encrypted = True )
1265
1304
1266
1305
# if it is 2 ways SSL
1267
1306
if keystore is not None and keystore != 'None' :
1268
- self .__set_connection_property (location , DRIVER_PARAMS_KEYSTORE_PROPERTY ,
1269
- self .__get_store_path (tns_admin , keystore ))
1307
+ self .__set_connection_property_info (location , DRIVER_PARAMS_KEYSTORE_PROPERTY ,
1308
+ self .__get_store_path (tns_admin , keystore ), properties_set )
1270
1309
1271
1310
if keystore_type is not None and keystore_type != 'None' :
1272
- self .__set_connection_property (location , DRIVER_PARAMS_KEYSTORETYPE_PROPERTY , keystore_type )
1311
+ self .__set_connection_property_info (location , DRIVER_PARAMS_KEYSTORETYPE_PROPERTY , keystore_type ,
1312
+ properties_set )
1313
+ return properties_set
1273
1314
1274
1315
def __set_atp_standard_conn_properties (self , datasource_name , tns_admin , truststore , truststore_pwd ,
1275
1316
truststore_type , keystore_pwd , keystore_type , keystore ):
1276
1317
location = deployer_utils .get_jdbc_driver_params_properties_location (datasource_name , self .aliases )
1277
1318
keystore , keystore_type , truststore , truststore_type = atp_helper .fix_store_type_and_default_value (keystore ,
1278
1319
keystore_type , truststore , truststore_type )
1279
1320
1321
+ properties_set = []
1322
+ self .__set_connection_property_info (location , DRIVER_PARAMS_KEYSTORE_PROPERTY , self .__get_store_path (tns_admin ,
1323
+ keystore ), properties_set )
1324
+
1325
+ self .__set_connection_property_info (location , DRIVER_PARAMS_KEYSTORETYPE_PROPERTY , keystore_type , properties_set )
1280
1326
1281
- self .__set_connection_property (location , DRIVER_PARAMS_KEYSTORE_PROPERTY , self .__get_store_path (tns_admin ,
1282
- keystore ))
1283
- self .__set_connection_property (location , DRIVER_PARAMS_KEYSTORETYPE_PROPERTY , keystore_type )
1284
1327
if keystore_pwd :
1285
- self .__set_connection_property (location , DRIVER_PARAMS_KEYSTOREPWD_PROPERTY , keystore_pwd , encrypted = True )
1286
- self .__set_connection_property (location , DRIVER_PARAMS_TRUSTSTORE_PROPERTY , self .__get_store_path (tns_admin ,
1287
- truststore ))
1288
- self .__set_connection_property (location , DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY , truststore_type )
1328
+ self .__set_connection_property_info (location , DRIVER_PARAMS_KEYSTOREPWD_PROPERTY , keystore_pwd ,
1329
+ properties_set , encrypted = True )
1330
+ self .__set_connection_property_info (location , DRIVER_PARAMS_TRUSTSTORE_PROPERTY , self .__get_store_path (tns_admin ,
1331
+ truststore ), properties_set )
1332
+ self .__set_connection_property_info (location , DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY , truststore_type ,
1333
+ properties_set )
1289
1334
if truststore_pwd :
1290
- self .__set_connection_property (location , DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY , truststore_pwd ,
1291
- encrypted = True )
1292
- self .__set_connection_property (location , DRIVER_PARAMS_NET_SSL_VERSION , '1.2' )
1293
- self .__set_connection_property (location , DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY , 'true' )
1294
- self .__set_connection_property (location , DRIVER_PARAMS_NET_TNS_ADMIN , tns_admin )
1295
- self .__set_connection_property (location , DRIVER_PARAMS_NET_FAN_ENABLED , 'false' )
1335
+ self .__set_connection_property_info (location , DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY , truststore_pwd ,
1336
+ properties_set , encrypted = True )
1337
+ self .__set_connection_property_info (location , DRIVER_PARAMS_NET_SSL_VERSION ,
1338
+ DRIVER_PARAMS_NET_SSL_VERSION_VALUE , properties_set )
1339
+ self .__set_connection_property_info (location , DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY , 'true' , properties_set )
1340
+ self .__set_connection_property_info (location , DRIVER_PARAMS_NET_TNS_ADMIN , tns_admin , properties_set )
1341
+ self .__set_connection_property_info (location , DRIVER_PARAMS_NET_FAN_ENABLED , 'false' , properties_set )
1342
+
1343
+ return properties_set
1296
1344
1297
1345
def __set_app_dir (self ):
1298
1346
"""
0 commit comments