13
13
from wlsdeploy .aliases .location_context import LocationContext
14
14
from wlsdeploy .aliases .model_constants import ADMIN_PASSWORD
15
15
from wlsdeploy .aliases .model_constants import ADMIN_USERNAME
16
- from wlsdeploy .aliases .model_constants import ATP_DEFAULT_TABLESPACE
17
- from wlsdeploy .aliases .model_constants import ATP_TEMPORARY_TABLESPACE
18
16
from wlsdeploy .aliases .model_constants import DATABASE_TYPE
19
17
from wlsdeploy .aliases .model_constants import DEFAULT_REALM
20
18
from wlsdeploy .aliases .model_constants import DOMAIN_INFO
21
19
from wlsdeploy .aliases .model_constants import DOMAIN_INFO_ALIAS
20
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTOREPWD_PROPERTY
21
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTORETYPE_PROPERTY
22
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_KEYSTORE_PROPERTY
22
23
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_NET_TNS_ADMIN
24
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY
25
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
26
+ from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
23
27
from wlsdeploy .aliases .model_constants import ORACLE_DATABASE_CONNECTION_TYPE
24
28
from wlsdeploy .aliases .model_constants import PASSWORD
25
29
from wlsdeploy .aliases .model_constants import PASSWORD_VALIDATOR
26
30
from wlsdeploy .aliases .model_constants import RCU_ADMIN_PASSWORD
27
31
from wlsdeploy .aliases .model_constants import RCU_DATABASE_TYPE
28
32
from wlsdeploy .aliases .model_constants import RCU_DB_CONN_STRING
29
33
from wlsdeploy .aliases .model_constants import RCU_DB_INFO
30
- from wlsdeploy .aliases .model_constants import RCU_DEFAULT_TABLESPACE
31
34
from wlsdeploy .aliases .model_constants import RCU_PREFIX
32
35
from wlsdeploy .aliases .model_constants import RCU_SCHEMA_PASSWORD
33
- from wlsdeploy .aliases .model_constants import RCU_TEMP_TBLSPACE
34
36
from wlsdeploy .aliases .model_constants import REALM
35
37
from wlsdeploy .aliases .model_constants import SECURITY
36
38
from wlsdeploy .aliases .model_constants import SECURITY_CONFIGURATION
39
+ from wlsdeploy .aliases .model_constants import STORE_TYPE_SSO
37
40
from wlsdeploy .aliases .model_constants import SYSTEM_PASSWORD_VALIDATOR
38
41
from wlsdeploy .aliases .model_constants import TNS_ENTRY
39
42
from wlsdeploy .aliases .model_constants import TOPOLOGY
43
46
from wlsdeploy .tool .validate .content_validator import ContentValidator
44
47
from wlsdeploy .util import dictionary_utils
45
48
46
- ALL_DB_TYPES = [
47
- RCURunner .ORACLE_DB_TYPE ,
48
- RCURunner .EBR_DB_TYPE ,
49
- RCURunner .SQLSERVER_DB_TYPE ,
50
- RCURunner .DB2_DB_TYPE ,
51
- RCURunner .MYSQL_DB_TYPE
52
- ]
53
-
54
49
ORACLE_DB_TYPES = [
55
50
RCURunner .ORACLE_DB_TYPE ,
56
51
RCURunner .EBR_DB_TYPE
57
52
]
58
53
59
- ORACLE_DB_CONNECTION_TYPES = [
54
+ ORACLE_DB_SSL_CONNECTION_TYPES = [
60
55
RCURunner .ORACLE_ATP_DB_TYPE ,
61
56
RCURunner .ORACLE_SSL_DB_TYPE
62
57
]
63
58
64
- DEPRECATED_DB_TYPES = [
65
- RCURunner .ORACLE_DB_TYPE ,
66
- RCURunner .ORACLE_ATP_DB_TYPE ,
67
- RCURunner .ORACLE_SSL_DB_TYPE
68
- ]
69
59
70
60
class CreateDomainContentValidator (ContentValidator ):
71
61
"""
@@ -114,6 +104,10 @@ def __validate_rcu_db_info_section(self, info_dict):
114
104
_method_name = '__validate_rcu_db_info_section'
115
105
self ._logger .entering (class_name = self ._class_name , method_name = _method_name )
116
106
107
+ # This method validates fields that can only be checked in a merged model.
108
+ # Simple checks that apply to an unmerged model, such as deprecations and value ranges,
109
+ # are done in domain_info_validator.py .
110
+
117
111
if not self ._model_context .get_domain_typedef ().requires_rcu ():
118
112
return
119
113
@@ -129,31 +123,21 @@ def __validate_rcu_db_info_section(self, info_dict):
129
123
130
124
self .__validate_rcu_connection_string (info_dict )
131
125
132
- # deprecated fields
133
- self ._check_deprecated_field (DATABASE_TYPE , info_dict , RCU_DB_INFO , ORACLE_DATABASE_CONNECTION_TYPE )
134
- self ._check_deprecated_field (ATP_DEFAULT_TABLESPACE , info_dict , RCU_DB_INFO , RCU_DEFAULT_TABLESPACE )
135
- self ._check_deprecated_field (ATP_TEMPORARY_TABLESPACE , info_dict , RCU_DB_INFO , RCU_TEMP_TBLSPACE )
136
-
137
- # deprecated DATABASE_TYPE, must be ORACLE, ATP, or SSL if specified
138
- old_database_type = dictionary_utils .get_element (info_dict , DATABASE_TYPE )
139
- if old_database_type and old_database_type not in DEPRECATED_DB_TYPES :
140
- self ._logger .severe (
141
- 'WLSDPLY-05302' , old_database_type , RCU_DB_INFO , DATABASE_TYPE ,
142
- ', ' .join (DEPRECATED_DB_TYPES ), class_name = self ._class_name , method_name = _method_name )
126
+ # ATP and SSL connection types must have TRUSTSTORE
127
+ for field in [ORACLE_DATABASE_CONNECTION_TYPE , DATABASE_TYPE ]:
128
+ connection_type = dictionary_utils .get_element (info_dict , field )
129
+ if connection_type and connection_type in ORACLE_DB_SSL_CONNECTION_TYPES :
130
+ truststore = dictionary_utils .get_element (info_dict , DRIVER_PARAMS_TRUSTSTORE_PROPERTY )
131
+ if not truststore :
132
+ self ._logger .severe (
133
+ 'WLSDPLY-05308' , field , connection_type , RCU_DB_INFO ,
134
+ DRIVER_PARAMS_TRUSTSTORE_PROPERTY , class_name = self ._class_name , method_name = _method_name )
143
135
144
- # RCU_DATABASE_TYPE must be one of allowed types if specified
145
- database_type = dictionary_utils .get_element (info_dict , RCU_DATABASE_TYPE )
146
- if database_type and database_type not in ALL_DB_TYPES :
147
- self ._logger .severe (
148
- 'WLSDPLY-05302' , database_type , RCU_DB_INFO , RCU_DATABASE_TYPE ,
149
- ', ' .join (ALL_DB_TYPES ), class_name = self ._class_name , method_name = _method_name )
136
+ self .__validate_store_property (DRIVER_PARAMS_TRUSTSTORE_PROPERTY , DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY ,
137
+ DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY , info_dict )
150
138
151
- # ORACLE_DATABASE_CONNECTION_TYPE must be one of allowed types if specified
152
- connection_type = dictionary_utils .get_element (info_dict , ORACLE_DATABASE_CONNECTION_TYPE )
153
- if connection_type and connection_type not in ORACLE_DB_CONNECTION_TYPES :
154
- self ._logger .severe (
155
- 'WLSDPLY-05302' , connection_type , RCU_DB_INFO , ORACLE_DATABASE_CONNECTION_TYPE ,
156
- ', ' .join (ORACLE_DB_CONNECTION_TYPES ), class_name = self ._class_name , method_name = _method_name )
139
+ self .__validate_store_property (DRIVER_PARAMS_KEYSTORE_PROPERTY , DRIVER_PARAMS_KEYSTORETYPE_PROPERTY ,
140
+ DRIVER_PARAMS_KEYSTOREPWD_PROPERTY , info_dict )
157
141
158
142
if self ._model_context .is_run_rcu ():
159
143
admin_password = dictionary_utils .get_element (info_dict , RCU_ADMIN_PASSWORD )
@@ -189,6 +173,22 @@ def __validate_rcu_connection_string(self, rcu_info_dict):
189
173
'WLSDPLY-05301' , RCU_DB_INFO , RCU_DB_CONN_STRING , RCURunner .ORACLE_DB_TYPE ,
190
174
class_name = self ._class_name , method_name = _method_name )
191
175
176
+ def __validate_store_property (self , store_property , type_property , pwd_property , rcu_info_dict ):
177
+ _method_name = '__validate_store_property'
178
+ store_value = dictionary_utils .get_element (rcu_info_dict , store_property )
179
+ if store_value :
180
+ type_value = dictionary_utils .get_element (rcu_info_dict , type_property )
181
+ if not type_value :
182
+ self ._logger .severe (
183
+ 'WLSDPLY-05310' , RCU_DB_INFO , type_property , store_property ,
184
+ class_name = self ._class_name , method_name = _method_name )
185
+
186
+ elif type_value .upper () != STORE_TYPE_SSO :
187
+ # types other than store must have password
188
+ if not dictionary_utils .get_element (rcu_info_dict , pwd_property ):
189
+ self ._logger .severe (
190
+ 'WLSDPLY-05309' , RCU_DB_INFO , pwd_property , type_property , type_value ,
191
+ class_name = self ._class_name , method_name = _method_name )
192
192
193
193
def __has_tns_path (self , rcu_info_dict ):
194
194
"""
@@ -363,13 +363,6 @@ def _get_users_dictionary(self, model_dict):
363
363
self ._logger .exiting (class_name = self ._class_name , method_name = _method_name )
364
364
return users_folder
365
365
366
- def _check_deprecated_field (self , field_name , info_dict , folder_name , new_field_name ):
367
- _method_name = '_check_deprecated_field'
368
- if dictionary_utils .get_element (info_dict , field_name ):
369
- self ._logger .deprecation (
370
- 'WLSDPLY-05303' , folder_name , field_name , new_field_name ,
371
- class_name = self ._class_name , method_name = _method_name )
372
-
373
366
374
367
def _get_system_password_validator_location ():
375
368
location = LocationContext ()
0 commit comments