|
72 | 72 | ERROR_FLATTENED_MBEAN_HAS_ATTRIBUTES = 3005
|
73 | 73 | ERROR_CANNOT_TEST_MBEAN_CD = 3006
|
74 | 74 | ERROR_SINGLE_UNPREDICTABLE = 3007
|
| 75 | +ERROR_FLATTENED_FOLDER_ERROR = 3008 |
75 | 76 |
|
76 | 77 | ERROR_ATTRIBUTE_ALIAS_NOT_FOUND = 4000
|
77 | 78 | ERROR_ATTRIBUTE_ALIAS_NOT_FOUND_IS_READONLY = 4001
|
|
107 | 108 | ERROR_UNABLE_TO_VERIFY_MBEAN_FOLDER: 'Unable to generate information for MBean',
|
108 | 109 | ERROR_ALIAS_FOLDER_NOT_IN_WLST: 'Alias Folder not an mbean',
|
109 | 110 | ERROR_SINGLE_UNPREDICTABLE: 'Alias Folder not marked single unpredictable',
|
| 111 | + ERROR_FLATTENED_FOLDER_ERROR: 'Alias Flattened Folder not found', |
110 | 112 | ERROR_FLATTENED_MBEAN_HAS_ATTRIBUTES: 'Alias flattened Folder has attributes',
|
111 | 113 | ERROR_USING_REFERENCE_AS_FOLDER: 'Reference attribute used as folder mbean',
|
112 | 114 | ERROR_ATTRIBUTE_ALIAS_NOT_FOUND: 'Attribute not found',
|
@@ -583,17 +585,9 @@ def _is_generated_attribute_readonly(self, location, generated_attribute, genera
|
583 | 585 | read_type = generated_attribute_info[CMO_READ_TYPE]
|
584 | 586 | _logger.finer('Using CMO read type {0} for attribute {1} which is in GET required list',
|
585 | 587 | read_type, generated_attribute, class_name=CLASS_NAME, method_name=_method_name)
|
586 |
| - # elif READ_TYPE in generated_attribute_info and CMO_READ_TYPE in generated_attribute_info: |
587 |
| - # if generated_attribute_info[READ_TYPE] == READ_ONLY or generated_attribute_info[CMO_READ_TYPE] == READ_ONLY: |
588 |
| - # read_type = READ_ONLY |
589 |
| - # else: |
590 |
| - # read_type = READ_WRITE |
591 |
| - # _logger.finer('Using both LSA read type {0} and CMO read type {1} for attribute {2}', |
592 |
| - # read_type, generated_attribute_info[CMO_READ_TYPE], generated_attribute, |
593 |
| - # class_name=CLASS_NAME, method_name=_method_name) |
594 | 588 | elif READ_TYPE in generated_attribute_info:
|
595 | 589 | read_type = generated_attribute_info[READ_TYPE]
|
596 |
| - _logger.finer('Using both LSA read type {0} for attribute {1}', read_type, generated_attribute, |
| 590 | + _logger.finer('Using read type {0} for attribute {1}', read_type, generated_attribute, |
597 | 591 | class_name=CLASS_NAME, method_name=_method_name)
|
598 | 592 | else:
|
599 | 593 | read_type = generated_attribute_info[CMO_READ_TYPE]
|
@@ -986,20 +980,32 @@ def _check_single_folder(self, dictionary, location, is_flattened_folder):
|
986 | 980 | :param is_flattened_folder: if current mbean is a flattened and single folder
|
987 | 981 | :param location: current location context of mbean
|
988 | 982 | """
|
| 983 | + _method_name = '_check_single_folder' |
| 984 | + _logger.entering(location.get_folder_path(), is_flattened_folder, |
| 985 | + class_name=CLASS_NAME, method_name=_method_name) |
| 986 | + |
989 | 987 | if INSTANCE_TYPE in dictionary:
|
990 | 988 | instance_type = dictionary[INSTANCE_TYPE]
|
991 | 989 | is_multiple = self._alias_helper.supports_multiple_mbean_instances(location)
|
992 | 990 | if is_flattened_folder:
|
993 | 991 | is_multiple = False
|
| 992 | + token_name = self._alias_helper.get_name_token(location) |
| 993 | + location.add_name_token(token_name, 'foo') |
994 | 994 | if is_multiple:
|
995 | 995 | if instance_type != MULTIPLE:
|
996 | 996 | self._add_error(location, ERROR_SINGLE_UNPREDICTABLE)
|
997 | 997 | else:
|
998 | 998 | try:
|
| 999 | + _logger.finer('Calling get_wlst_mbean_name() on location {0}', location.get_folder_path, |
| 1000 | + class_name=CLASS_NAME, method_name=_method_name) |
999 | 1001 | token_name = self._alias_helper.get_wlst_mbean_name(location)
|
1000 |
| - except AliasException: |
1001 |
| - self._add_error(location, ERROR_ATTRIBUTE_INVALID_VERSION) |
| 1002 | + except AliasException, e: |
| 1003 | + if is_flattened_folder: |
| 1004 | + self._add_error(location, ERROR_FLATTENED_FOLDER_ERROR, message=str(e)) |
| 1005 | + else: |
| 1006 | + self._add_error(location, ERROR_ATTRIBUTE_INVALID_VERSION) |
1002 | 1007 | return
|
| 1008 | + |
1003 | 1009 | if instance_type == SINGLE_NO_NAME:
|
1004 | 1010 | if token_name != 'NO_NAME_0':
|
1005 | 1011 | self._add_error(location, ERROR_ATTRIBUTE_MUST_BE_NO_NAME)
|
|
0 commit comments