@@ -286,6 +286,8 @@ def __run_rcu(self):
286
286
if rcu_db_info .is_use_atp ():
287
287
# ATP database, build runner map from RCUDbInfo in the model.
288
288
289
+ # check it first
290
+ self .__retrieve_atp_rcudbinfo (rcu_db_info , True )
289
291
# make a copy of model's map to pass to RCURunner, since we will modify some values
290
292
rcu_properties_map = self .model .get_model_domain_info ()[RCU_DB_INFO ]
291
293
rcu_runner_map = dict (rcu_properties_map )
@@ -893,6 +895,61 @@ def __set_atp_connection_property(self, root_location, property_name, property_v
893
895
894
896
root_location .remove_name_token (property_name )
895
897
898
+ def __retrieve_atp_rcudbinfo (self , rcu_db_info , checkAdminPwd = False ):
899
+ """
900
+ Check and return atp connection info and make sure atp rcudb info is complete
901
+ :raises: CreateException: if an error occurs
902
+ """
903
+ _method_name = '__retrieve_atp_rcudbinfo'
904
+
905
+ tns_admin = rcu_db_info .get_atp_tns_admin ()
906
+
907
+ if tns_admin is None or not os .path .exists (tns_admin + os .sep + "tnsnames.ora" ):
908
+ ex = exception_helper .create_create_exception ('WLSDPLY-12562' )
909
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
910
+ raise ex
911
+
912
+ if rcu_db_info .get_atp_entry () is None :
913
+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'tns.alias' ,
914
+ "['tns.alias','javax.net.ssl.keyStorePassword',"
915
+ "'javax.net.ssl.trustStorePassword']" )
916
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
917
+ raise ex
918
+
919
+ rcu_database = atp_helper .get_atp_connect_string (tns_admin + os .sep + 'tnsnames.ora' ,
920
+ rcu_db_info .get_atp_entry ())
921
+
922
+ if rcu_database is None :
923
+ ex = exception_helper .create_create_exception ('WLSDPLY-12563' , rcu_db_info .get_atp_entry ())
924
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
925
+ raise ex
926
+
927
+ keystore_pwd = rcu_db_info .get_keystore_password ()
928
+ truststore_pwd = rcu_db_info .get_truststore_password ()
929
+
930
+ if keystore_pwd is None :
931
+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'javax.net.ssl.keyStorePassword' ,
932
+ "['tns.alias','javax.net.ssl.keyStorePassword',"
933
+ "'javax.net.ssl.trustStorePassword']" )
934
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
935
+ raise ex
936
+
937
+ if truststore_pwd is None :
938
+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'javax.net.ssl.trustStorePassword' ,
939
+ "['tns.alias','javax.net.ssl.keyStorePassword',"
940
+ "'javax.net.ssl.trustStorePassword']" )
941
+ raise ex
942
+
943
+ if checkAdminPwd :
944
+ admin_pwd = rcu_db_info .get_admin_password ()
945
+ if admin_pwd is None :
946
+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'rcu_admin_password' ,
947
+ "['rcu_prefix','rcu_schema_password',"
948
+ "'rcu_admin_password']" )
949
+ raise ex
950
+
951
+ return tns_admin , rcu_database , keystore_pwd , truststore_pwd
952
+
896
953
def __configure_fmw_infra_database (self ):
897
954
"""
898
955
Configure the FMW Infrastructure DataSources.
@@ -911,19 +968,29 @@ def __configure_fmw_infra_database(self):
911
968
rcu_prefix = rcu_db_info .get_preferred_prefix ()
912
969
rcu_schema_pwd = rcu_db_info .get_preferred_schema_pass ()
913
970
971
+ if rcu_prefix is None :
972
+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'rcu_prefix' ,
973
+ "['rcu_prefix','rcu_schema_password']" )
974
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
975
+ raise ex
976
+
977
+ if rcu_schema_pwd is None :
978
+ ex = exception_helper .create_create_exception ('WLSDPLY-12413' ,'rcu_schema_password' ,
979
+ "['rcu_prefix','rcu_schema_password']" )
980
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
981
+ raise ex
982
+
914
983
# For ATP databases : we need to set all the property for each datasource
915
984
# load atp connection properties from properties file
916
985
# HANDLE ATP case
917
986
918
987
if rcu_db_info .has_atpdbinfo ():
919
988
has_atp = 1
920
989
# parse the tnsnames.ora file and retrieve the connection string
921
- tns_admin = rcu_db_info .get_atp_tns_admin ()
922
- rcu_database = atp_helper .get_atp_connect_string (tns_admin + os .sep + 'tnsnames.ora' ,
923
- rcu_db_info .get_atp_entry ())
990
+ # tns_admin is the wallet path either the path to $DOMAIN_HOME/atpwallet or
991
+ # specified in RCUDbinfo.oracle.net.tns_admin
924
992
925
- keystore_pwd = rcu_db_info .get_keystore_password ()
926
- truststore_pwd = rcu_db_info .get_truststore_password ()
993
+ tns_admin , rcu_database , keystore_pwd , truststore_pwd = self .__retrieve_atp_rcudbinfo (rcu_db_info )
927
994
928
995
# Need to set for the connection property for each datasource
929
996
@@ -988,9 +1055,11 @@ def __configure_fmw_infra_database(self):
988
1055
if not has_atp :
989
1056
rcu_database = rcu_db_info .get_preferred_db ()
990
1057
if rcu_database is None :
991
- return
1058
+ ex = exception_helper .create_create_exception ('WLSDPLY-12564' )
1059
+ raise ex
992
1060
993
1061
fmw_database = self .wls_helper .get_jdbc_url_from_rcu_connect_string (rcu_database )
1062
+
994
1063
self .logger .fine ('WLSDPLY-12221' , fmw_database , class_name = self .__class_name , method_name = _method_name )
995
1064
996
1065
svc_table_ds_name = self .wls_helper .get_jrf_service_table_datasource_name ()
0 commit comments