@@ -93,8 +93,9 @@ def create_placeholder_jdbc_resources(self, resources):
93
93
Create a placeholder JDBC resource for each name in the resources section.
94
94
This is necessary because cluster attributes may reference JDBC resources.
95
95
:param resources: the resource model nodes
96
+ :return: a list of names of created placeholders
96
97
"""
97
- self .create_placeholder_named_elements (LocationContext (), JDBC_SYSTEM_RESOURCE , resources )
98
+ return self .create_placeholder_named_elements (LocationContext (), JDBC_SYSTEM_RESOURCE , resources )
98
99
99
100
def create_placeholder_named_elements (self , location , model_type , model_nodes ):
100
101
"""
@@ -103,8 +104,10 @@ def create_placeholder_named_elements(self, location, model_type, model_nodes):
103
104
:param location: the location for the nodes to be added
104
105
:param model_type: the type of the specified model nodes
105
106
:param model_nodes: the model nodes
107
+ :return: a list of names of created placeholders
106
108
"""
107
109
_method_name = 'create_placeholder_named_elements'
110
+ holder_names = []
108
111
original_location = self .wlst_helper .get_pwd ()
109
112
resource_location = LocationContext (location ).append_location (model_type )
110
113
@@ -125,8 +128,10 @@ def create_placeholder_named_elements(self, location, model_type, model_nodes):
125
128
resource_location .add_name_token (token , name )
126
129
deployer_utils .create_and_cd (resource_location , existing_names , self .alias_helper )
127
130
self ._update_placeholder (model_type , name , resource_location )
131
+ holder_names .append (name )
128
132
129
133
self .wlst_helper .cd (original_location )
134
+ return holder_names
130
135
131
136
def _update_placeholder (self , type_name , name , location ):
132
137
"""
@@ -148,31 +153,25 @@ def _update_placeholder(self, type_name, name, location):
148
153
self .wlst_helper .set ('Name' , name )
149
154
self .wlst_helper .cd (original_location )
150
155
151
- def clear_jdbc_placeholder_targeting (self , resources ):
156
+ def clear_jdbc_placeholder_targeting (self , jdbc_names ):
152
157
"""
153
- Remove any targets for the JDBC resources in the specified dictionary .
158
+ Remove any targets for the JDBC resources in the specified list of names .
154
159
Targets may have been inadvertently assigned when clusters were added after JDBC placeholders.
155
- :param resources: dictionary containing the resources section of the model
160
+ :param jdbc_names: names of placeholders to clear
156
161
"""
157
162
_method_name = 'clear_jdbc_placeholder_targeting'
158
163
resource_location = LocationContext ().append_location (JDBC_SYSTEM_RESOURCE )
159
164
token = self .alias_helper .get_name_token (resource_location )
160
165
161
- if self .alias_helper .get_wlst_mbean_type (resource_location ) is not None :
162
- name_nodes = dictionary_utils .get_dictionary_element (resources , JDBC_SYSTEM_RESOURCE )
163
- for name in name_nodes .keys ():
164
- if model_helper .is_delete_name (name ):
165
- # don't clear placeholder for delete names
166
- continue
167
-
168
- self .logger .info ('WLSDPLY-19404' , JDBC_SYSTEM_RESOURCE , name , class_name = self .__class_name ,
169
- method_name = _method_name )
166
+ for name in jdbc_names :
167
+ self .logger .info ('WLSDPLY-19404' , JDBC_SYSTEM_RESOURCE , name , class_name = self .__class_name ,
168
+ method_name = _method_name )
170
169
171
- resource_location .add_name_token (token , name )
172
- wlst_path = self .alias_helper .get_wlst_attributes_path (resource_location )
173
- if self .wlst_helper .path_exists (wlst_path ):
174
- mbean = self .wlst_helper .get_mbean_for_wlst_path (wlst_path )
175
- mbean .setTargets (None )
170
+ resource_location .add_name_token (token , name )
171
+ wlst_path = self .alias_helper .get_wlst_attributes_path (resource_location )
172
+ if self .wlst_helper .path_exists (wlst_path ):
173
+ mbean = self .wlst_helper .get_mbean_for_wlst_path (wlst_path )
174
+ mbean .setTargets (None )
176
175
177
176
def qualify_nm_properties (self , type_name , model_nodes , base_location , model_context , attribute_setter ):
178
177
"""
0 commit comments