@@ -258,7 +258,10 @@ def _verify_aliases_at_location(self, generated_dictionary, location, folder_map
258258 location .get_folder_path (), class_name = CLASS_NAME , method_name = _method_name )
259259 self ._check_attribute_list_for_flattened (location , attributes )
260260 # Swallow the intermediate layer that is not relevant in a flattened location
261- this_dictionary = this_dictionary [this_dictionary .keys ()[2 ]]
261+ _logger .finer ('MBean {0} now at dictionary {1}' , entry , this_dictionary .keys (),
262+ class_name = CLASS_NAME , method_name = _method_name )
263+ this_dictionary = self ._get_next_entry (this_dictionary )
264+
262265 attributes = _get_generated_attribute_list (this_dictionary )
263266 flattened_folder = True
264267 self ._check_single_folder (this_dictionary , location , flattened_folder )
@@ -274,6 +277,22 @@ def _verify_aliases_at_location(self, generated_dictionary, location, folder_map
274277
275278 _logger .exiting (class_name = CLASS_NAME , method_name = _method_name )
276279
280+ def _get_next_entry (self , dictionary ):
281+ keys = dictionary .keys ()
282+ if len (keys ) == 3 :
283+ if ATTRIBUTES in keys [0 ] or INSTANCE_TYPE in keys [0 ]:
284+ if ATTRIBUTES in keys [2 ] or INSTANCE_TYPE in keys [2 ]:
285+ next_entry = dictionary [keys [1 ]]
286+ else :
287+ next_entry = dictionary [keys [2 ]]
288+ else :
289+ next_entry = dictionary [keys [0 ]]
290+ elif len (keys ) == 1 :
291+ next_entry = dictionary [keys [0 ]]
292+ else :
293+ return dictionary
294+ return next_entry
295+
277296 def _check_generated_against_alias_folders (self , location , generated_dictionary , folder_map ):
278297 """
279298 Verify the aliases MBeans for the current location for MBeans are in the generated dictionary.
0 commit comments