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 model_deployer
75
74
from wlsdeploy .tool .util .topology_helper import TopologyHelper
76
75
from wlsdeploy .util import dictionary_utils
77
76
from wlsdeploy .util import model as model_helper
78
- from wlsdeploy .tool .create import atp_helper
79
77
80
78
81
79
class DomainCreator (Creator ):
@@ -222,15 +220,15 @@ def __run_rcu(self):
222
220
rcu_properties_map = self .model .get_model_domain_info ()[RCU_DB_INFO ]
223
221
224
222
if ATP_TNS_ENTRY in rcu_properties_map :
225
- rcu_schema_pass = rcu_properties_map [ RCU_SCHEMA_PASSWORD ]
226
- rcu_sys_pass = rcu_properties_map [ RCU_ADMIN_PASSWORD ]
223
+ rcu_schema_pass = rcudbinfo_helper . get_rcu_schema_password ( rcu_properties_map )
224
+ rcu_sys_pass = rcudbinfo_helper . get_admin_password ( rcu_properties_map )
227
225
runner = RCURunner (domain_type , oracle_home , java_home , rcu_schemas , rcu_properties_map )
228
226
runner .runRcu (rcu_sys_pass , rcu_schema_pass )
229
227
else :
230
- rcu_db = rcu_properties_map [ RCU_DB_CONN ]
231
- rcu_prefix = rcu_properties_map [ RCU_PREFIX ]
232
- rcu_sys_pass = rcu_properties_map [ RCU_ADMIN_PASSWORD ]
233
- rcu_schema_pass = rcu_properties_map [ RCU_SCHEMA_PASSWORD ]
228
+ rcu_db = rcudbinfo_helper . get_rcu_regular_db_conn ( rcu_properties_map )
229
+ rcu_prefix = rcudbinfo_helper . get_rcu_prefix ( rcu_properties_map )
230
+ rcu_sys_pass = rcudbinfo_helper . get_admin_password ( rcu_properties_map )
231
+ rcu_schema_pass = rcudbinfo_helper . get_rcu_schema_password ( rcu_properties_map )
234
232
235
233
runner = RCURunner (domain_type , oracle_home , java_home , rcu_db , rcu_prefix , rcu_schemas )
236
234
runner .runRcu (rcu_sys_pass , rcu_schema_pass )
@@ -715,55 +713,6 @@ def __set_atp_connection_property(self, root_location, propery_name, property_va
715
713
716
714
root_location .remove_name_token (propery_name )
717
715
718
- # def _get_atp_connect_string(self, tnsnames_ora_path, tns_sid_name):
719
- #
720
- #
721
- # try:
722
- # f = open(tnsnames_ora_path, "r+")
723
- # try:
724
- # text = f.read()
725
- # finally:
726
- # f.close()
727
- # # The regex below looks for the <dbName>_<level><whitespaces>=<whitespaces> and grabs the
728
- # # tnsConnectString from the current and the next line as tnsnames.ora file has the connect string
729
- # # being printed on 2 lines.
730
- # pattern = tns_sid_name + '\s*=\s*([(].*\n.*)'
731
- # match = re.search(pattern, text)
732
- # if match:
733
- # str = match.group(1)
734
- # tnsConnectString=str.replace('\r','').replace('\n','')
735
- # str = self._format_connect_string(tnsConnectString)
736
- # return str
737
- # except:
738
- # pass
739
- #
740
- # return None
741
- #
742
- # def _format_connect_string(self, connect_string):
743
- # """
744
- # Formats connect string for ATP DB by removing unwanted whitespaces.
745
- # Input:
746
- # (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")) )
747
- # Output Parts:
748
- # 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=(
749
- # 2. ssl_server_cert_dn=
750
- # 3. "CN=adwc-preprod.uscom-east-1.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US"
751
- # 4. )))
752
- # :param connect_string:
753
- # :return:
754
- # """
755
- # pattern = "(.*)(ssl_server_cert_dn=)\s*(\".*\")(.*)"
756
- # match = re.search(pattern, connect_string)
757
- #
758
- # if match:
759
- # part1 = match.group(1).replace(' ','')
760
- # part2 = match.group(2).replace(' ', '')
761
- # # We don't want to remove the spaces from serverDN part.
762
- # part3 = match.group(3)
763
- # part4 = match.group(4).replace(' ', '')
764
- # connect_string = "%s%s%s%s" % (part1, part2, part3, part4)
765
- #
766
- # return connect_string
767
716
768
717
def __configure_fmw_infra_database (self ):
769
718
"""
@@ -781,21 +730,19 @@ def __configure_fmw_infra_database(self):
781
730
782
731
if RCU_DB_INFO in domain_info :
783
732
rcu_properties_map = domain_info [RCU_DB_INFO ]
784
- #rcu_properties_map = self.model.get_model_domain_info()[RCU_DB_INFO]
785
733
# HANDLE ATP case
786
734
787
735
if ATP_TNS_ENTRY in rcu_properties_map :
788
736
has_atp = 1
789
737
# parse the tnsnames.ora file and retrieve the connection string
790
738
tns_admin = rcu_properties_map [DRIVER_PARAMS_NET_TNS_ADMIN ]
791
739
rcu_database = atp_helper .get_atp_connect_string (tns_admin + os .sep + 'tnsnames.ora' ,
792
- rcu_properties_map [
793
- ATP_TNS_ENTRY ])
740
+ rcudbinfo_helper .get_atp_entry (rcu_properties_map ))
794
741
795
- rcu_prefix = rcu_properties_map [ RCU_PREFIX ]
796
- rcu_schema_pwd = rcu_properties_map [ RCU_SCHEMA_PASSWORD ]
797
- keystore_pwd = rcu_properties_map [ DRIVER_PARAMS_KEYSTOREPWD_PROPERTY ]
798
- truststore_pwd = rcu_properties_map [ DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY ]
742
+ rcu_prefix = rcudbinfo_helper . get_rcu_prefix ( rcu_properties_map )
743
+ rcu_schema_pwd = rcudbinfo_helper . get_rcu_schema_password ( rcu_properties_map )
744
+ keystore_pwd = rcudbinfo_helper . get_keystore_password ( rcu_properties_map )
745
+ truststore_pwd = rcudbinfo_helper . get_truststore_password ( rcu_properties_map )
799
746
800
747
# Need to set for the connection proeprty for each datasource
801
748
0 commit comments