Skip to content

Commit 29ad6fc

Browse files
committed
Merge branch 'wdt-github-1495' into 'main'
Fix online mbean info interface discovery. See merge request weblogic-cloud/weblogic-deploy-tooling!1509
2 parents b562029 + caeab06 commit 29ad6fc

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def discover_custom_mbean(self, base_location, model_type, mbean_name):
6565
class_name=_class_name, method_name=_method_name)
6666
location = LocationContext(base_location)
6767
subfolder_result = PyOrderedDict()
68-
6968
attribute_helper = self._info_helper.get_info_attribute_helper(location)
7069
if attribute_helper is None:
7170
_logger.warning('WLSDPLY-06753', model_type, str_helper.to_string(attribute_helper), mbean_name,
@@ -76,13 +75,22 @@ def discover_custom_mbean(self, base_location, model_type, mbean_name):
7675
class_name=_class_name, method_name=_method_name)
7776
short_name = attribute_helper.get_mbean_name()
7877
# This is not like other custom interface names and should be changed to be more flexible
79-
interface_name = security_provider_interface_name(attribute_helper.get_mbean_instance(),
80-
attribute_helper.get_mbean_interface_name())
78+
79+
if self._model_context.is_wlst_offline():
80+
interface_name = security_provider_interface_name(attribute_helper.get_mbean_instance(),
81+
attribute_helper.get_mbean_interface_name())
82+
else:
83+
mbi = self._wlst_helper.get_mbi()
84+
descriptor = mbi.getDescriptor()
85+
interface_name = descriptor.getFieldValue('interfaceclassname')
86+
interface_name = _strip_mbean_from_string(interface_name)
87+
8188
subfolder_result[mbean_name][interface_name] = PyOrderedDict()
8289
_logger.info('WLSDPLY-06751', model_type, short_name, class_name=_class_name, method_name=_method_name)
8390
_logger.info('WLSDPLY-06752', mbean_name, model_type, short_name,
8491
class_name=_class_name, method_name=_method_name)
8592
subfolder_result[mbean_name][interface_name] = self.get_model_attribute_map(location, attribute_helper)
93+
8694
_logger.exiting(class_name=_class_name, method_name=_method_name)
8795
return subfolder_result
8896

@@ -374,15 +382,18 @@ def security_provider_interface_name(mbean_instance, mbean_interface_name):
374382
result = mbean_interface_name
375383
_logger.warning('WLSDPLY-06779', str_helper.to_string(mbean_instance),
376384
class_name=_class_name, method_name=_method_name)
385+
377386
except (Exception, JException):
378387
_logger.warning('WLSDPLY-06778', mbean_interface_name, class_name=_class_name, method_name=_method_name)
379388
result = mbean_interface_name
389+
return _strip_mbean_from_string(result)
390+
391+
def _strip_mbean_from_string(result):
380392
idx = result.rfind('MBean')
381393
if idx > 0:
382394
result = result[:idx]
383395
return result
384396

385-
386397
def attribute_type(attribute_helper, attribute_name):
387398
"""
388399
Use the attribute helper to return the attribute type.

0 commit comments

Comments
 (0)