Skip to content

Commit 3d0da7c

Browse files
authored
Issue #568 Set JDBCSystemResource / JdbcResource / Name when creating placeholders (#569)
1 parent d5b28cf commit 3d0da7c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from wlsdeploy.aliases.model_constants import CLUSTER
1212
from wlsdeploy.aliases.model_constants import COHERENCE_CLUSTER_SYSTEM_RESOURCE
1313
from wlsdeploy.aliases.model_constants import CUSTOM_IDENTITY_KEYSTORE_FILE
14+
from wlsdeploy.aliases.model_constants import JDBC_RESOURCE
1415
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
1516
from wlsdeploy.aliases.model_constants import NM_PROPERTIES
1617
from wlsdeploy.aliases.model_constants import SERVER
@@ -123,9 +124,30 @@ def create_placeholder_named_elements(self, location, model_type, model_nodes):
123124
token = self.alias_helper.get_name_token(resource_location)
124125
resource_location.add_name_token(token, name)
125126
deployer_utils.create_and_cd(resource_location, existing_names, self.alias_helper)
127+
self._update_placeholder(model_type, name, resource_location)
126128

127129
self.wlst_helper.cd(original_location)
128130

131+
def _update_placeholder(self, type_name, name, location):
132+
"""
133+
Make any required updates to a newly-created placeholder.
134+
:param type_name: the type name of the placeholder
135+
:param name: the name of the placeholder MBean
136+
:param location: the location of the placeholder
137+
"""
138+
if type_name == JDBC_SYSTEM_RESOURCE:
139+
# for online update, Name must be assigned to each JDBCSystemResource / JdbcResource MBean.
140+
# (see datasource_deployer.set_attributes())
141+
child_location = LocationContext(location).append_location(JDBC_RESOURCE)
142+
wlst_path = self.alias_helper.get_wlst_attributes_path(child_location)
143+
if self.wlst_helper.path_exists(wlst_path):
144+
original_location = self.wlst_helper.get_pwd()
145+
self.wlst_helper.cd(wlst_path)
146+
existing_name = self.wlst_helper.get('Name')
147+
if existing_name is None:
148+
self.wlst_helper.set('Name', name)
149+
self.wlst_helper.cd(original_location)
150+
129151
def qualify_nm_properties(self, type_name, model_nodes, base_location, model_context, attribute_setter):
130152
"""
131153
For the NM properties MBean, update the keystore file path to be fully qualified with the domain directory.

0 commit comments

Comments
 (0)