Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,14 @@ def create_security_type(self, mbean_type):

singular = mbean_type
if singular.endswith('s'):
# FIXME - This doesn't seem very rigorous, e.g., directories => directory
lenm = len(mbean_type)-1
singular = mbean_type[0:lenm]
for item in types:
idx = item.rfind('.')
short = item[idx + 1:]
package = short
mbean_instance = generator_wlst.created_security_provider(singular, short, package)
mbean_instance = generator_wlst.create_security_provider(singular, short, package)
orig = generator_wlst.current_path()
folder_dict[short] = PyOrderedDict()
folder_dict[short][ATTRIBUTES] = self.__get_attributes(mbean_instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def generate_security_mbean(self, dictionary, mbean_type):
short = item[idx + 1:]
orig = generator_wlst.current_path()
if short not in existing:
mbean_instance = generator_wlst.created_security_provider(mbean_type, short, item)
mbean_instance = generator_wlst.create_security_provider(mbean_type, short, item)
generator_wlst.cd_mbean(curr_path + '/' + mbean_type + '/' + short)
else:
mbean_instance = generator_wlst.get_mbean_proxy(curr_path + '/' + mbean_type + '/' + short)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def created(mbean_type, name):
return True


def created_security_provider(mbean_type, name, package):
def create_security_provider(mbean_type, name, package):
"""
Create the MBean with the provided name at the current wlst location. WLST Exceptions are caught and returned
as False from the method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ def _does_alias_attribute_exist(self, location, generated_attribute, generated_a
message = 'Since Version=', generated_attribute_info[SINCE_VERSION]

if generated_attribute.lower() in lower_case_list:
self._add_error(location, ERROR_ATTRIBUTE_INCORRECT_CASE, attribute=generated_attribute)
expected_wlst_name = _get_dict_key_from_value(alias_name_map, generated_attribute.lower())
message = 'WLST name in aliases is %s' % expected_wlst_name
self._add_error(location, ERROR_ATTRIBUTE_INCORRECT_CASE,
message=message, attribute=generated_attribute)
elif self._is_generated_attribute_readonly(location, generated_attribute, generated_attribute_info):
self._add_error(location, ERROR_ATTRIBUTE_ALIAS_NOT_FOUND_IS_READONLY,
attribute=generated_attribute, message=message)
Expand Down Expand Up @@ -1457,6 +1460,15 @@ def _type_can_be_lsa_string(attribute_type):
attribute_type in alias_constants.ALIAS_MAP_TYPES


def _get_dict_key_from_value(alias_name_map, lower_case_value):
result = None
for key, value in alias_name_map.iteritems():
if value == lower_case_value:
result = key
break
return result


class VerifierResult(object):
CLASS_NAME = 'VerifierResult'

Expand Down