Skip to content

Commit 23274a0

Browse files
committed
Merge branch 'jrf-precheck-overrides' into 'develop-4.0'
Fixing precheck to honor model-specified STB DataSource overrides of the RCUDbInfo attributes See merge request weblogic-cloud/weblogic-deploy-tooling!1657
2 parents 2b4e82f + 3467e68 commit 23274a0

File tree

3 files changed

+57
-11
lines changed

3 files changed

+57
-11
lines changed

core/src/main/python/wlsdeploy/tool/create/jps_config_helper.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55
import os
66
from xml.dom.minidom import parse
77

8+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_KEYSTORE_PROPERTY
9+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_KEYSTOREPWD_PROPERTY
10+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_KEYSTORETYPE_PROPERTY
11+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY
12+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_NET_SSL_VERSION
813
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_NET_SSL_VERSION_VALUE
14+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_NET_TNS_ADMIN
15+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
16+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY
17+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
918
from wlsdeploy.logging.platform_logger import get_logged_value
1019
from wlsdeploy.logging.platform_logger import PlatformLogger
1120
from wlsdeploy.util import string_utils
@@ -69,19 +78,19 @@ def __set_ssl_properties(self, xml_doc, tns_admin, truststore, truststore_type,
6978

7079
for prop in props:
7180
if prop.getAttribute('name') == 'props.db.1':
72-
self.__set_property(dom_tree, prop, 'oracle.net.ssl_server_dn_match', 'true')
73-
self.__set_property(dom_tree, prop, 'oracle.net.ssl_version', DRIVER_PARAMS_NET_SSL_VERSION_VALUE)
74-
self.__set_property(dom_tree, prop, 'oracle.net.tns_admin', tns_admin)
75-
self.__set_property(dom_tree, prop, 'javax.net.ssl.trustStoreType', truststore_type)
76-
self.__set_property(dom_tree, prop, 'javax.net.ssl.keyStoreType', keystore_type)
77-
self.__set_property(dom_tree, prop, 'javax.net.ssl.keyStore', keystore)
78-
self.__set_property(dom_tree, prop, 'javax.net.ssl.trustStore', truststore)
81+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_NET_SERVER_DN_MATCH_PROPERTY, 'true')
82+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_NET_SSL_VERSION, DRIVER_PARAMS_NET_SSL_VERSION_VALUE)
83+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_NET_TNS_ADMIN, tns_admin)
84+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY, truststore_type)
85+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_KEYSTORETYPE_PROPERTY, keystore_type)
86+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_KEYSTORE_PROPERTY, keystore)
87+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_TRUSTSTORE_PROPERTY, truststore)
7988

8089
if keystore_type != 'SSO':
81-
self.__set_property(dom_tree, prop, 'javax.net.ssl.keyStorePassword', keystore_password, True)
90+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_KEYSTOREPWD_PROPERTY, keystore_password, True)
8291

8392
if truststore_type != 'SSO':
84-
self.__set_property(dom_tree, prop, 'javax.net.ssl.trustStorePassword', truststore_password, True)
93+
self.__set_property(dom_tree, prop, DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY, truststore_password, True)
8594

8695
# Persist the changes in the xml file
8796
file_handle = None

core/src/main/python/wlsdeploy/tool/util/rcu_helper.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
4646
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
4747
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_USER_PROPERTY
48+
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS
4849
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
50+
from wlsdeploy.aliases.model_constants import JDBC_RESOURCE
4951
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
5052
from wlsdeploy.aliases.model_constants import PASSWORD_ENCRYPTED
5153
from wlsdeploy.aliases.model_constants import RCU_COMP_INFO
@@ -228,9 +230,9 @@ def __precheck_rcu_connectivity(self):
228230
self.__logger.entering(class_name=self.__class_name, method_name=_method_name)
229231

230232
domain_typename = self._model_context.get_domain_typedef().get_domain_type()
233+
231234
rcu_prefix = self._rcu_db_info.get_rcu_prefix()
232235
schema_name = None
233-
234236
user_name = None
235237
if not string_utils.is_empty(rcu_prefix):
236238
user_name = self._model_context.get_weblogic_helper().get_stb_user_name(rcu_prefix)
@@ -264,6 +266,10 @@ def __precheck_rcu_connectivity(self):
264266
props.put('user', user_name)
265267
props.put('password', rcu_schema_pwd)
266268

269+
# Pick up any values overridden by any model resources section overrides for the STB datasource.
270+
jdbc_driver_name, jdbc_conn_string = \
271+
self.__update_precheck_from_model_data_source(jdbc_driver_name, jdbc_conn_string, props)
272+
267273
# Force the driver to be loaded and registered...
268274
JClass.forName(jdbc_driver_name)
269275
DriverManager.getConnection(jdbc_conn_string, props)
@@ -839,3 +845,32 @@ def __get_jdbc_driver_class_name(self, rcu_database_type, is_xa=False):
839845

840846
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name, result=driver_name)
841847
return driver_name
848+
849+
def __update_precheck_from_model_data_source(self, jdbc_driver_name, jdbc_conn_string, props):
850+
_method_name = '__update_precheck_from_model_data_source'
851+
self.__logger.entering(jdbc_driver_name, jdbc_conn_string,
852+
class_name=self.__class_name, method_name=_method_name)
853+
854+
model_resources_dict = self._model_object.get_model_resources()
855+
data_source_name = self._model_context.get_weblogic_helper().get_jrf_service_table_datasource_name()
856+
data_sources_dict = dictionary_utils.get_dictionary_element(model_resources_dict, JDBC_SYSTEM_RESOURCE)
857+
model_data_source_dict = dictionary_utils.get_dictionary_element(data_sources_dict, data_source_name)
858+
model_jdbc_resource_dict = dictionary_utils.get_dictionary_element(model_data_source_dict, JDBC_RESOURCE)
859+
model_driver_params_dict = dictionary_utils.get_dictionary_element(model_jdbc_resource_dict, JDBC_DRIVER_PARAMS)
860+
model_properties_dict = \
861+
dictionary_utils.get_dictionary_element(model_driver_params_dict, JDBC_DRIVER_PARAMS_PROPERTIES)
862+
863+
new_jdbc_driver_name = dictionary_utils.get_element(model_driver_params_dict, DRIVER_NAME, jdbc_driver_name)
864+
new_jdbc_conn_string = dictionary_utils.get_element(model_driver_params_dict, URL, jdbc_conn_string)
865+
866+
new_password = dictionary_utils.get_element(model_driver_params_dict, PASSWORD_ENCRYPTED)
867+
if new_password is not None:
868+
new_password = self._aliases.decrypt_password(new_password)
869+
props.set('password', new_password)
870+
871+
for prop_key, prop_value in model_properties_dict.iteritems():
872+
props.set(prop_key, prop_value)
873+
874+
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name,
875+
result=[new_jdbc_driver_name, new_jdbc_conn_string])
876+
return new_jdbc_driver_name, new_jdbc_conn_string

documentation/4.0/content/release-notes/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pre = "<b> </b>"
2727
with online Update Domain and Deploy Applications tools. For non-archive applications/libraries, online deployment of
2828
binaries outside of the archive will always assume that the binaries are available to the Administration Server at the
2929
model-specified paths. Neither the `-remote` or SSH options will attempt to upload the non-archived binaries.
30-
- #1654 - Overhaul of the Create Domain Tool's support for running RCU and applying RCU-related changes to the
30+
- #1654, #1655, #1656, #1658 - Overhaul of the Create Domain Tool's support for running RCU and applying RCU-related changes to the
3131
RCU Data Sources.
3232

3333
#### Other Changes
@@ -91,6 +91,8 @@ pre = "<b> </b>"
9191
- #1642 - Fixed deployment issues with deploying applications not included in an archive file.
9292
- #1643 - Fixed an issue with Discover Domain where application/library path tokenization was preventing adding
9393
deployments to the archive file.
94+
- #1657 - Fixed an issue with the JRF precheck functionality of the Create Domain Tool where it was ignoring any Data
95+
Source overrides for the STB data source set in the model.
9496

9597
#### Known Issues
9698
- SSH support requires a reasonably recent version of Bouncy Castle. WDT picks up Bouncy Castle from WLST so, for example,

0 commit comments

Comments
 (0)