Skip to content

Commit ea981d1

Browse files
compensate for change in 14.1.1 mbean interface (#1107)
1 parent 90686a4 commit ea981d1

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

core/src/main/python/wlsdeploy/tool/discover/custom_folder_helper.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2019, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2019, 2022, Oracle Corporation and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55

@@ -117,7 +117,7 @@ def get_model_attribute_value(self, attribute_helper, attribute_name, wlst_value
117117
add_value = None
118118
mbean_string = attribute_helper.mbean_string()
119119
if attribute_helper.is_read_only(attribute_name):
120-
_logger.finer('WLDSPLY-06776', mbean_string, attribute_name,
120+
_logger.finer('WLSDPLY-06776', mbean_string, attribute_name,
121121
class_name=_class_name, method_name=_method_name)
122122
else:
123123
model_type, model_value = self.__convert_to_type(attribute_helper, attribute_name, wlst_value)
@@ -130,14 +130,16 @@ def get_model_attribute_value(self, attribute_helper, attribute_name, wlst_value
130130
class_name=_class_name, method_name=_method_name)
131131
default_value = self.__get_default_value(attribute_helper, attribute_name)
132132
if not is_empty(model_value):
133+
if not is_empty(default_value):
134+
converted_type, default_value = self.convert(default_value, type(default_value))
133135
if is_empty(default_value) or not self.is_default(model_value, model_type, default_value):
134136
add_value = model_value
135137
if add_value is not None and model_type == alias_constants.PASSWORD:
136138
add_value = alias_constants.PASSWORD_TOKEN
137139

138-
else:
139-
_logger.finer('WLSDPLY-06771', mbean_string, attribute_name, attribute_helper.get_type(attribute_name),
140-
class_name=_class_name, method_name=_method_name)
140+
# else:
141+
# _logger.finer('WLSDPLY-06771', mbean_string, attribute_name, attribute_helper.get_type(attribute_name),
142+
# class_name=_class_name, method_name=_method_name)
141143

142144
return add_value
143145

@@ -149,6 +151,9 @@ def convert(self, value, value_type):
149151
:return: converted data type and value
150152
"""
151153
_method_name = 'convert_method'
154+
if str(value_type).startswith('<type '):
155+
# strip off type, introduced in 14.1.1
156+
value_type = str(value_type)[7:-2]
152157
converted_type = None
153158
converted = None
154159
try:
@@ -183,7 +188,7 @@ def convert(self, value, value_type):
183188
converted_type = alias_constants.STRING
184189
if value is not None:
185190
converted = value.toString()
186-
elif value_type == 'PyArray' or value_type.startswith('[L'):
191+
elif value_type == 'PyArray' or value_type.startswith('[L') or value_type == 'array.array':
187192
converted = create_array(value)
188193
if converted is not None:
189194
converted_type = alias_constants.JARRAY

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2019, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2019, 2022, Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import re
@@ -826,7 +826,7 @@ def setter(self, attribute_name):
826826
descriptor = self.__get_mbean_attribute(attribute_name)
827827
if descriptor is not None:
828828
setter = descriptor.getWriteMethod()
829-
if setter is not None and str(setter.getReturnType()) == 'void':
829+
if setter is not None and (str(setter.getReturnType()) == 'void' or str(setter.getReturnType()) == "<type \'void\'>"):
830830
return setter.getName()
831831
return None
832832

0 commit comments

Comments
 (0)