Skip to content

Commit 189777d

Browse files
Wdt 948 delete readd does not work (#956)
* Allow Set DatasourceAutomaticMigration to None * Allow Set DatasourceAutomaticMigration to None * Change to set mbean type
1 parent 5dfb01a commit 189777d

File tree

4 files changed

+42
-5
lines changed

4 files changed

+42
-5
lines changed

core/src/main/python/wlsdeploy/aliases/aliases.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,36 @@ def get_model_lsa_required_attribute_names(self, location):
797797

798798
return lsa_required_attribute_names
799799

800+
def model_mbean_has_set_mbean_type_attribute_name(self, location, model_name):
801+
"""
802+
Determine if the attribute for model_name has the set_mbean type value.
803+
:param location: the location
804+
:param model_name: the attribute name
805+
:return: True if the attribute has the set method value
806+
:raises: Tool type exception: if an error occurs
807+
"""
808+
_method_name = 'model_mbean_has_set_mbean_type_attribute_name'
809+
810+
try:
811+
module_folder = self._alias_entries.get_dictionary_for_location(location, resolve=False)
812+
if ATTRIBUTES not in module_folder:
813+
ex = exception_helper.create_alias_exception('WLSDPLY-08400', location.get_folder_path())
814+
self._logger.throwing(ex, class_name=self._class_name, method_name=_method_name)
815+
raise ex
816+
817+
set_mbean_type = False
818+
819+
if model_name in module_folder[ATTRIBUTES] and \
820+
SET_MBEAN_TYPE in module_folder[ATTRIBUTES][model_name]:
821+
822+
set_mbean_type = True
823+
824+
return set_mbean_type
825+
except AliasException, ae:
826+
827+
self._raise_exception(ae, _method_name, 'WLSDPLY-19017', location.get_folder_path(),
828+
ae.getLocalizedMessage())
829+
800830
def get_model_mbean_set_method_attribute_names_and_types(self, location):
801831
"""
802832
Get the list of model attribute names and types where the set method requires an MBean.

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,14 @@ def set_data_source_mbean(self, location, key, value, wlst_value):
236236
:param wlst_value: the existing value of the attribute from WLST
237237
:raises BundleAwareException of the specified type: if DataSource is not found
238238
"""
239-
mbean = self.__find_in_resource_group_or_domain(location, JDBC_SYSTEM_RESOURCE, value, required=True)
240-
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
239+
if not value:
240+
mbean = self.__wlst_helper.get_mbean(None)
241+
wlst_attr = wlst_param = self.__aliases.get_wlst_attribute_name(location, key)
242+
method = getattr(mbean, 'set' + wlst_attr)
243+
method(None)
244+
else:
245+
mbean = self.__find_in_resource_group_or_domain(location, JDBC_SYSTEM_RESOURCE, value, required=True)
246+
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
241247
return
242248

243249
def set_saf_remote_context_mbean(self, location, key, value, wlst_value):

core/src/main/python/wlsdeploy/tool/validate/validator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,9 @@ def __validate_attribute(self, attribute_name, attribute_value, valid_attr_infos
683683
self._logger.finer('WLSDPLY-05016', attribute_name, expected_data_type, actual_data_type,
684684
class_name=_class_name, method_name=_method_name)
685685
if validation_utils.is_compatible_data_type(expected_data_type, actual_data_type) is False:
686-
self._logger.warning('WLSDPLY-05017', attribute_name, model_folder_path, expected_data_type,
687-
actual_data_type, class_name=_class_name, method_name=_method_name)
686+
if not self._aliases.model_mbean_has_set_mbean_type_attribute_name(validation_location, attribute_name):
687+
self._logger.warning('WLSDPLY-05017', attribute_name, model_folder_path, expected_data_type,
688+
actual_data_type, class_name=_class_name, method_name=_method_name)
688689

689690
if attribute_name in path_tokens_attr_keys:
690691
self.__validate_path_tokens_attribute(attribute_name, attribute_value, model_folder_path)

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Cluster.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
"CoherenceClusterSystemResource": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "CoherenceClusterSystemResource", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "set_method": "${:MBEAN.set_coherence_cluster_mbean}", "set_mbean_type": "${:weblogic.management.configuration.CoherenceClusterSystemResourceMBean}", "restart_required": "true" } ],
185185
"ConcurrentSingletonActivationEnabled": [ {"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "ConcurrentSingletonActivationEnabled", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean", "restart_required": "true" } ],
186186
"ConsensusParticipants": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsensusParticipants", "wlst_path": "WP001", "value": {"default": 0 }, "wlst_type": "integer", "get_method": "GET" } ],
187-
"DataSourceForAutomaticMigration": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForAutomaticMigration", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "${LSA:GET}", "set_method": "${:MBEAN.set_data_source_mbean}", "set_mbean_type": "${:weblogic.management.configuration.JDBCSystemResourceMBean}", "restart_required": "true" } ],
187+
"DataSourceForAutomaticMigration": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForAutomaticMigration", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "${LSA:GET}", "set_method": "MBEAN.set_data_source_mbean", "set_mbean_type": "weblogic.management.configuration.JDBCSystemResourceMBean", "restart_required": "true" } ],
188188
"DataSourceForJobScheduler": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForJobScheduler", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "set_method": "${:MBEAN.set_data_source_mbean}", "set_mbean_type": "${:weblogic.management.configuration.JDBCSystemResourceMBean}" } ],
189189
"DataSourceForSessionPersistence": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForSessionPersistence", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "set_method": "${:MBEAN.set_data_source_mbean}", "set_mbean_type": "${:weblogic.management.configuration.JDBCSystemResourceMBean}", "restart_required": "true" } ],
190190
"DatabaseLeasingBasisConnectionRetryCount": [ {"version": "[12.1.3,)", "wlst_mode": "both", "wlst_name": "DatabaseLeasingBasisConnectionRetryCount", "wlst_path": "WP001", "value": {"default": 1 }, "wlst_type": "integer", "get_method": "GET", "restart_required": "true" } ],

0 commit comments

Comments
 (0)