Skip to content

Commit 9ff0c76

Browse files
committed
Merge branch 'jps-config-overrides' into 'develop-4.0'
Adding model overrides for opss-data-source driver properties in setting jps-config.xml See merge request weblogic-cloud/weblogic-deploy-tooling!1659
2 parents 0ca3bd1 + 746c83a commit 9ff0c76

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

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

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,30 @@
1515
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
1616
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTOREPWD_PROPERTY
1717
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
18+
from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_USER_PROPERTY
19+
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS
20+
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
21+
from wlsdeploy.aliases.model_constants import JDBC_RESOURCE
22+
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
1823
from wlsdeploy.aliases.model_constants import STORE_TYPE_SSO
1924
from wlsdeploy.logging.platform_logger import get_logged_value
2025
from wlsdeploy.logging.platform_logger import PlatformLogger
26+
from wlsdeploy.util import dictionary_utils
2127
from wlsdeploy.util import string_utils
2228

29+
OPSS_DATA_SOURCE_NAME = 'opss-data-source'
30+
2331

2432
class JpsConfigHelper(object):
2533
_logger = PlatformLogger('wlsdeploy.create')
2634
_class_name = 'JpsConfigHelper'
2735

28-
def __init__(self, model_context, rcu_db_info):
36+
def __init__(self, model_object, model_context, rcu_db_info):
37+
self._model_object = model_object
2938
self._model_context = model_context
3039
self._rcu_db_info = rcu_db_info
3140
self._use_ssl = rcu_db_info.is_use_atp() or rcu_db_info.is_use_ssl()
41+
self._opss_data_source_model_props = self.__get_opss_data_source_model_properties()
3242

3343
def fix_jps_config(self):
3444
_method_name = 'fix_jps_config'
@@ -121,12 +131,35 @@ def __set_property(self, dom_tree, prop, name, value, logMask=False):
121131
else:
122132
self._logger.entering(name, value, logMask, class_name=self._class_name, method_name=_method_name)
123133

124-
if not string_utils.is_empty(value):
134+
value_to_set = dictionary_utils.get_element(self._opss_data_source_model_props, name, value)
135+
if not string_utils.is_empty(value_to_set):
125136
property_element = dom_tree.createElement('property')
126137
property_element.setAttribute("name", name)
127-
property_element.setAttribute("value", value)
138+
property_element.setAttribute("value", value_to_set)
128139
prop.appendChild(property_element)
129140
newline = dom_tree.createTextNode('\n')
130141
prop.appendChild(newline)
131142

132143
self._logger.exiting(class_name=self._class_name, method_name=_method_name)
144+
145+
def __get_opss_data_source_model_properties(self):
146+
_method_name = '__get_opss_data_source_model_properties'
147+
self._logger.entering(class_name=self._class_name, method_name=_method_name)
148+
149+
model_resources_dict = self._model_object.get_model_resources()
150+
model_data_sources_dict = dictionary_utils.get_dictionary_element(model_resources_dict, JDBC_SYSTEM_RESOURCE)
151+
model_opss_data_source_dict = \
152+
dictionary_utils.get_dictionary_element(model_data_sources_dict, OPSS_DATA_SOURCE_NAME)
153+
model_jdbc_resource_dict = dictionary_utils.get_dictionary_element(model_opss_data_source_dict, JDBC_RESOURCE)
154+
model_driver_params_dict = dictionary_utils.get_dictionary_element(model_jdbc_resource_dict, JDBC_DRIVER_PARAMS)
155+
model_driver_props_dict = \
156+
dictionary_utils.get_dictionary_element(model_driver_params_dict, JDBC_DRIVER_PARAMS_PROPERTIES)
157+
158+
opss_model_props = dict()
159+
for prop_key, prop_value in model_driver_props_dict.iteritems():
160+
if prop_key == DRIVER_PARAMS_USER_PROPERTY:
161+
continue
162+
opss_model_props[prop_key] = prop_value
163+
164+
self._logger.exiting(class_name=self._class_name, method_name=_method_name)
165+
return opss_model_props

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def update_rcu_password(self, modify_bootstrap_credential=True):
218218

219219
def fix_jps_config(self):
220220
if self._model_context.get_domain_typedef().requires_rcu():
221-
jps_config_helper = JpsConfigHelper(self._model_context, self._rcu_db_info)
221+
jps_config_helper = JpsConfigHelper(self._model_object, self._model_context, self._rcu_db_info)
222222
jps_config_helper.fix_jps_config()
223223

224224
####################

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ 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, #1655, #1656, #1658 - Overhaul of the Create Domain Tool's support for running RCU and applying RCU-related changes to the
31-
RCU Data Sources.
30+
- #1654, #1655, #1656, #1658, #1659, #1660 - Overhaul of the Create Domain Tool's support for running RCU and applying
31+
RCU-related changes to the RCU Data Sources.
3232

3333
#### Other Changes
3434
- #1544 - Consolidated multiple internal WLST helper methods to get an MBean.
@@ -91,8 +91,10 @@ 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
94+
- #1657 - Fixed an issue with the JRF pre-check functionality of the Create Domain Tool where it was ignoring any Data
9595
Source overrides for the STB data source set in the model.
96+
- #1659 - Fixed an issue with the Create Domain Tool where it was ignoring any Data Source overrides for the OPSS data
97+
source set in the model when fixing the jps-copfig.xml and jps-config-jse.xml files.
9698

9799
#### Known Issues
98100
- 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)