10
10
from wlsdeploy .aliases .model_constants import ADMIN_SERVER_NAME
11
11
from wlsdeploy .aliases .model_constants import ADMIN_USERNAME
12
12
from wlsdeploy .aliases .model_constants import APP_DIR
13
+ from wlsdeploy .aliases .model_constants import ATP_TNS_ENTRY
13
14
from wlsdeploy .aliases .model_constants import CLUSTER
14
15
from wlsdeploy .aliases .model_constants import DEFAULT_ADMIN_SERVER_NAME
15
16
from wlsdeploy .aliases .model_constants import DEFAULT_WLS_DOMAIN_NAME
16
17
from wlsdeploy .aliases .model_constants import DOMAIN_NAME
17
18
from wlsdeploy .aliases .model_constants import DRIVER_NAME
18
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_PROPERTY_VALUE
19
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_USER_PROPERTY
20
-
21
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
22
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_kEYSTORE_PROPERTY
23
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
24
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTORETYPE_PROPERTY
25
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY
26
19
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTOREPWD_PROPERTY
20
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTORETYPE_PROPERTY
21
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_FAN_ENABLED
27
22
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY
28
23
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_SSL_VERSION
29
24
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_TNS_ADMIN
30
- from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_FAN_ENABLED
31
- from wlsdeploy .aliases .model_constants import RCU_PREFIX
32
- from wlsdeploy .aliases .model_constants import RCU_SCHEMA_PASSWORD
33
- from wlsdeploy .aliases .model_constants import RCU_ADMIN_PASSWORD
34
-
35
- from wlsdeploy .aliases .model_constants import ATP_TNS_ENTRY
36
- from wlsdeploy .aliases .model_constants import RCU_DB_INFO
37
- from wlsdeploy .aliases .model_constants import RCU_DB_CONN
25
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_PROPERTY_VALUE
26
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY
27
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
28
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
29
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_USER_PROPERTY
30
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_kEYSTORE_PROPERTY
38
31
from wlsdeploy .aliases .model_constants import JDBC_DRIVER_PARAMS
39
32
from wlsdeploy .aliases .model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
40
33
from wlsdeploy .aliases .model_constants import JDBC_RESOURCE
46
39
from wlsdeploy .aliases .model_constants import PARTITION
47
40
from wlsdeploy .aliases .model_constants import PASSWORD
48
41
from wlsdeploy .aliases .model_constants import PASSWORD_ENCRYPTED
42
+ from wlsdeploy .aliases .model_constants import RCU_DB_CONN
43
+ from wlsdeploy .aliases .model_constants import RCU_DB_INFO
44
+ from wlsdeploy .aliases .model_constants import RCU_PREFIX
45
+ from wlsdeploy .aliases .model_constants import RCU_SCHEMA_PASSWORD
49
46
from wlsdeploy .aliases .model_constants import RESOURCE_GROUP
50
47
from wlsdeploy .aliases .model_constants import RESOURCE_GROUP_TEMPLATE
51
48
from wlsdeploy .aliases .model_constants import SECURITY
66
63
from wlsdeploy .aliases .model_constants import XML_REGISTRY
67
64
from wlsdeploy .exception import exception_helper
68
65
from wlsdeploy .exception .expection_types import ExceptionType
66
+ from wlsdeploy .tool .create import atp_helper
67
+ from wlsdeploy .tool .create import rcudbinfo_helper
69
68
from wlsdeploy .tool .create .creator import Creator
70
69
from wlsdeploy .tool .create .security_provider_creator import SecurityProviderCreator
71
70
from wlsdeploy .tool .deploy import deployer_utils
76
75
from wlsdeploy .tool .util .topology_helper import TopologyHelper
77
76
from wlsdeploy .util import dictionary_utils
78
77
from wlsdeploy .util import model as model_helper
79
- from wlsdeploy .tool .create import atp_helper
80
78
81
79
82
80
class DomainCreator (Creator ):
@@ -214,15 +212,15 @@ def __run_rcu(self):
214
212
rcu_properties_map = self .model .get_model_domain_info ()[RCU_DB_INFO ]
215
213
216
214
if ATP_TNS_ENTRY in rcu_properties_map :
217
- rcu_schema_pass = rcu_properties_map [ RCU_SCHEMA_PASSWORD ]
218
- rcu_sys_pass = rcu_properties_map [ RCU_ADMIN_PASSWORD ]
215
+ rcu_schema_pass = rcudbinfo_helper . get_rcu_schema_password ( rcu_properties_map )
216
+ rcu_sys_pass = rcudbinfo_helper . get_admin_password ( rcu_properties_map )
219
217
runner = RCURunner (domain_type , oracle_home , java_home , rcu_schemas , rcu_properties_map )
220
218
runner .runRcu (rcu_sys_pass , rcu_schema_pass )
221
219
else :
222
- rcu_db = rcu_properties_map [ RCU_DB_CONN ]
223
- rcu_prefix = rcu_properties_map [ RCU_PREFIX ]
224
- rcu_sys_pass = rcu_properties_map [ RCU_ADMIN_PASSWORD ]
225
- rcu_schema_pass = rcu_properties_map [ RCU_SCHEMA_PASSWORD ]
220
+ rcu_db = rcudbinfo_helper . get_rcu_regular_db_conn ( rcu_properties_map )
221
+ rcu_prefix = rcudbinfo_helper . get_rcu_prefix ( rcu_properties_map )
222
+ rcu_sys_pass = rcudbinfo_helper . get_admin_password ( rcu_properties_map )
223
+ rcu_schema_pass = rcudbinfo_helper . get_rcu_schema_password ( rcu_properties_map )
226
224
227
225
runner = RCURunner (domain_type , oracle_home , java_home , rcu_db , rcu_prefix , rcu_schemas )
228
226
runner .runRcu (rcu_sys_pass , rcu_schema_pass )
@@ -709,55 +707,6 @@ def __set_atp_connection_property(self, root_location, propery_name, property_va
709
707
710
708
root_location .remove_name_token (propery_name )
711
709
712
- # def _get_atp_connect_string(self, tnsnames_ora_path, tns_sid_name):
713
- #
714
- #
715
- # try:
716
- # f = open(tnsnames_ora_path, "r+")
717
- # try:
718
- # text = f.read()
719
- # finally:
720
- # f.close()
721
- # # The regex below looks for the <dbName>_<level><whitespaces>=<whitespaces> and grabs the
722
- # # tnsConnectString from the current and the next line as tnsnames.ora file has the connect string
723
- # # being printed on 2 lines.
724
- # pattern = tns_sid_name + '\s*=\s*([(].*\n.*)'
725
- # match = re.search(pattern, text)
726
- # if match:
727
- # str = match.group(1)
728
- # tnsConnectString=str.replace('\r','').replace('\n','')
729
- # str = self._format_connect_string(tnsConnectString)
730
- # return str
731
- # except:
732
- # pass
733
- #
734
- # return None
735
- #
736
- # def _format_connect_string(self, connect_string):
737
- # """
738
- # Formats connect string for ATP DB by removing unwanted whitespaces.
739
- # Input:
740
- # (description= (address=(protocol=tcps)(port=1522)(host=adb-preprod.us-phoenix-1.oraclecloud.com))(connect_data=(service_name=uq7p1eavz8qlvts_watsh01_medium.atp.oraclecloud.com))(security=(ssl_server_cert_dn= "CN=adwc-preprod.uscom-east-1.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")) )
741
- # Output Parts:
742
- # 1. (description=(address=(protocol=tcps)(port=1522)(host=adb-preprod.us-phoenix-1.oraclecloud.com))(connect_data=(service_name=uq7p1eavz8qlvts_watsh01_medium.atp.oraclecloud.com))(security=(
743
- # 2. ssl_server_cert_dn=
744
- # 3. "CN=adwc-preprod.uscom-east-1.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US"
745
- # 4. )))
746
- # :param connect_string:
747
- # :return:
748
- # """
749
- # pattern = "(.*)(ssl_server_cert_dn=)\s*(\".*\")(.*)"
750
- # match = re.search(pattern, connect_string)
751
- #
752
- # if match:
753
- # part1 = match.group(1).replace(' ','')
754
- # part2 = match.group(2).replace(' ', '')
755
- # # We don't want to remove the spaces from serverDN part.
756
- # part3 = match.group(3)
757
- # part4 = match.group(4).replace(' ', '')
758
- # connect_string = "%s%s%s%s" % (part1, part2, part3, part4)
759
- #
760
- # return connect_string
761
710
762
711
def __configure_fmw_infra_database (self ):
763
712
"""
@@ -775,21 +724,19 @@ def __configure_fmw_infra_database(self):
775
724
776
725
if RCU_DB_INFO in domain_info :
777
726
rcu_properties_map = domain_info [RCU_DB_INFO ]
778
- #rcu_properties_map = self.model.get_model_domain_info()[RCU_DB_INFO]
779
727
# HANDLE ATP case
780
728
781
729
if ATP_TNS_ENTRY in rcu_properties_map :
782
730
has_atp = 1
783
731
# parse the tnsnames.ora file and retrieve the connection string
784
732
tns_admin = rcu_properties_map [DRIVER_PARAMS_NET_TNS_ADMIN ]
785
733
rcu_database = atp_helper .get_atp_connect_string (tns_admin + os .sep + 'tnsnames.ora' ,
786
- rcu_properties_map [
787
- ATP_TNS_ENTRY ])
734
+ rcudbinfo_helper .get_atp_entry (rcu_properties_map ))
788
735
789
- rcu_prefix = rcu_properties_map [ RCU_PREFIX ]
790
- rcu_schema_pwd = rcu_properties_map [ RCU_SCHEMA_PASSWORD ]
791
- keystore_pwd = rcu_properties_map [ DRIVER_PARAMS_KEYSTOREPWD_PROPERTY ]
792
- truststore_pwd = rcu_properties_map [ DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY ]
736
+ rcu_prefix = rcudbinfo_helper . get_rcu_prefix ( rcu_properties_map )
737
+ rcu_schema_pwd = rcudbinfo_helper . get_rcu_schema_password ( rcu_properties_map )
738
+ keystore_pwd = rcudbinfo_helper . get_keystore_password ( rcu_properties_map )
739
+ truststore_pwd = rcudbinfo_helper . get_truststore_password ( rcu_properties_map )
793
740
794
741
# Need to set for the connection proeprty for each datasource
795
742
0 commit comments