Skip to content

Commit 7780543

Browse files
authored
Merge pull request #233 from oracle/wdt-50-groupparams
Wdt 50 groupparams
2 parents f3b17c1 + dbf9917 commit 7780543

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
import javaos as os
@@ -143,7 +143,7 @@ def _get_attributes_for_current_location_online(self, location):
143143
path = self._alias_helper.get_wlst_attributes_path(location)
144144
try:
145145
lsa_attributes = wlst_helper.lsa(path)
146-
mbi_attributes = _get_mbi_attribute_list()
146+
mbi_attributes = _get_mbi_attribute_list(path)
147147
if mbi_attributes:
148148
for lsa_attribute_name in lsa_attributes:
149149
if lsa_attribute_name in lsa_attributes and lsa_attribute_name not in mbi_attributes:
@@ -659,9 +659,9 @@ def convert_to_absolute_path(relative_to, file_name):
659659
return file_name
660660

661661

662-
def _get_mbi_attribute_list():
662+
def _get_mbi_attribute_list(path):
663663
attribute_list = []
664-
for mbean_attribute_info in wlst_helper.get_mbi().getAttributes():
664+
for mbean_attribute_info in wlst_helper.get_mbi(path).getAttributes():
665665
if _is_attribute(mbean_attribute_info):
666666
attribute_list.append(mbean_attribute_info.getName())
667667
return attribute_list
@@ -705,7 +705,7 @@ def _massage_online_folders(lsc_folders):
705705
location = wlst_helper.get_pwd()
706706
folder_list = []
707707
mbi_folder_list = []
708-
for mbean_attribute_info in wlst_helper.get_mbi().getAttributes():
708+
for mbean_attribute_info in wlst_helper.get_mbi(location).getAttributes():
709709
if _is_containment(mbean_attribute_info):
710710
mbi_folder_list.append(mbean_attribute_info.getName())
711711
for lsc_folder in lsc_folders:

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,14 @@ def _get_group_params(self, location):
321321
class_name=_class_name, method_name=_method_name)
322322
else:
323323
group_param_name = attributes[wlst_subdeployment]
324-
_logger.finer('WLSDPLY-06487', group_param_name, self._alias_helper.get_model_folder_path(location),
325-
class_name=_class_name, method_name=_method_name)
326-
subfolder_result[group_param_name] = OrderedDict()
327-
self._populate_model_parameters(subfolder_result[group_param_name], location)
324+
if group_param_name is None:
325+
_logger.warning('WLSDPLY-06486', folder_name, self._alias_helper.get_model_folder_path(location),
326+
class_name=_class_name, method_name=_method_name)
327+
else:
328+
_logger.finer('WLSDPLY-06487', group_param_name, self._alias_helper.get_model_folder_path(location),
329+
class_name=_class_name, method_name=_method_name)
330+
subfolder_result[group_param_name] = OrderedDict()
331+
self._populate_model_parameters(subfolder_result[group_param_name], location)
328332
location.remove_name_token(name_token)
329333
location.pop_location()
330334
_logger.exiting(class_name=_class_name, method_name=_method_name, result=subfolder_result)

core/src/main/python/wlsdeploy/util/wlst_helper.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
import com.oracle.cie.domain.script.jython.WLSTException as offlineWLSTException
@@ -1103,9 +1103,20 @@ def _get_wlst_mode():
11031103
return result
11041104

11051105

1106-
def get_mbi():
1106+
def get_mbi(path=None):
11071107
"""
1108-
Get the MBeanInfo for the current MBean location.
1108+
Get the MBeanInfo for the current or specifiec MBean location.
1109+
:param path: optionally specify path to check
11091110
:return: javax.management.modelmbean.ModelMBeanInfo instance for the current location
11101111
"""
1111-
return wlst.getMBI()
1112+
current_path = None
1113+
if path is not None:
1114+
current_path = get_pwd()
1115+
cd(path)
1116+
1117+
result = wlst.getMBI()
1118+
1119+
if current_path is not None:
1120+
cd(current_path)
1121+
1122+
return result

0 commit comments

Comments
 (0)