@@ -1056,15 +1056,19 @@ def _check_complex_type(self, location, generated_attribute, generated_attr_info
1056
1056
:return: True if the delimited type contains properties
1057
1057
"""
1058
1058
_method_name = '_check_complex_type'
1059
- _logger .entering (generated_attribute , alias_type , model_name ,
1059
+ _logger .entering (location . get_folder_path (), generated_attribute , alias_type , model_name ,
1060
1060
class_name = CLASS_NAME , method_name = _method_name )
1061
1061
1062
1062
valid = False
1063
1063
lsa_type , get_type , cmo_type = _get_attribute_types (generated_attr_info )
1064
- _logger .finest ('Attribute {0} lsa_type {1} cmo_type {2} get_type {3} : alias_type {4} get required {5}' ,
1065
- generated_attribute , lsa_type , cmo_type , get_type , alias_type ,
1066
- Boolean (generated_attribute in get_required_attribute_list ),
1067
- class_name = CLASS_NAME , method_name = _method_name )
1064
+ if _logger .is_finest_enabled ():
1065
+ wlst_read_type = self ._alias_helper .get_wlst_read_type (location , model_name )
1066
+ _logger .finest ('Location {0} Attribute {1} with alias_type {2}: lsa_type={3} cmo_type={4}'
1067
+ ' get_type={5} wlst_read_type={6}, get_required={7}' ,
1068
+ location .get_folder_path (), generated_attribute , alias_type , lsa_type , cmo_type , get_type ,
1069
+ wlst_read_type , Boolean (generated_attribute in get_required_attribute_list ),
1070
+ class_name = CLASS_NAME , method_name = _method_name )
1071
+
1068
1072
if alias_type == alias_constants .SEMI_COLON_DELIMITED_STRING and \
1069
1073
_is_of_type_with_lsa (generated_attribute , alias_constants .PROPERTIES , generated_attr_info ,
1070
1074
get_required_attribute_list ):
@@ -1083,6 +1087,9 @@ def _check_complex_type(self, location, generated_attribute, generated_attr_info
1083
1087
alias_constants .ALIAS_DELIMITED_TYPES :
1084
1088
self ._add_invalid_type_error (location , generated_attribute , alias_constants .STRING , alias_type ,
1085
1089
get_required_attribute_list , 'GET or WLST_READ_TYPE required' )
1090
+ elif _is_wlst_read_type_compatible_list_type (generated_attribute , lsa_type ,
1091
+ self ._alias_helper .get_wlst_read_type (location , model_name )):
1092
+ valid = True
1086
1093
elif alias_type == alias_constants .LIST :
1087
1094
if _is_of_type_with_get_required (generated_attribute , alias_type , generated_attr_info ,
1088
1095
get_required_attribute_list ):
@@ -1094,6 +1101,9 @@ def _check_complex_type(self, location, generated_attribute, generated_attr_info
1094
1101
alias_constants .ALIAS_DELIMITED_TYPES :
1095
1102
self ._add_invalid_type_error (location , generated_attribute , alias_constants .STRING , alias_type ,
1096
1103
get_required_attribute_list , 'LSA GET_METHOD requires WLST_READ_TYPE' )
1104
+ elif _is_wlst_read_type_compatible_list_type (generated_attribute , lsa_type ,
1105
+ self ._alias_helper .get_wlst_read_type (location , model_name )):
1106
+ valid = True
1097
1107
elif alias_type in alias_constants .ALIAS_DELIMITED_TYPES :
1098
1108
if _is_any_string_type (generated_attr_info ):
1099
1109
valid = True
@@ -1232,24 +1242,46 @@ def _get_attribute_types(attribute_info):
1232
1242
return lsa_type , get_type , cmo_type
1233
1243
1234
1244
1235
- def _is_of_type_with_lsa (attribute , alias_type , attribute_info , get_required_attribute_list ):
1245
+ def _is_of_type_with_get_required (attribute , alias_type , attribute_info , get_required_attribute_list ):
1236
1246
lsa_type , get_type , cmo_type = _get_attribute_types (attribute_info )
1237
- return attribute not in get_required_attribute_list and lsa_type is not None and \
1238
- (lsa_type == alias_type or
1239
- ((_is_type_an_unknown_type (lsa_type ) or lsa_type == alias_constants .STRING or
1240
- lsa_type == alias_constants .INTEGER ) and
1241
- ((_is_type_an_unknown_type (get_type ) and cmo_type is None ) or (get_type == alias_type
1242
- or cmo_type == alias_type ))))
1247
+ return attribute in get_required_attribute_list and (get_type == alias_type or cmo_type == alias_type )
1243
1248
1244
1249
1245
- def _is_in_types_with_get_required (attribute , alias_types , attribute_info , get_required_attribute_list ):
1250
+ def _is_of_type_with_lsa (attribute , alias_type , attribute_info , get_required_attribute_list ):
1246
1251
lsa_type , get_type , cmo_type = _get_attribute_types (attribute_info )
1247
- return attribute in get_required_attribute_list and (get_type in alias_types or cmo_type in alias_types )
1248
1252
1253
+ is_lsa_type = attribute not in get_required_attribute_list and lsa_type is not None
1254
+ is_lsa_and_alias_types_equal = lsa_type == alias_type
1255
+ is_lsa_type_unknown = _is_type_an_unknown_type (lsa_type )
1256
+ is_lsa_type_string_or_integer = lsa_type == alias_constants .STRING or lsa_type == alias_constants .INTEGER
1257
+ is_lsa_type_unknown_or_string_or_integer = is_lsa_type_unknown or is_lsa_type_string_or_integer
1258
+ is_lsa_type_unknown_and_cmo_type_is_none = _is_type_an_unknown_type (get_type ) and cmo_type is None
1259
+ is_get_and_alias_types_equal = get_type == alias_type
1260
+ is_cmo_and_alias_types_equal = cmo_type == alias_type
1261
+ is_cmo_or_get_and_alias_types_equal = is_get_and_alias_types_equal or is_cmo_and_alias_types_equal
1249
1262
1250
- def _is_of_type_with_get_required (attribute , alias_type , attribute_info , get_required_attribute_list ):
1263
+ return is_lsa_type and \
1264
+ (is_lsa_and_alias_types_equal or
1265
+ (is_lsa_type_unknown_or_string_or_integer and
1266
+ (is_lsa_type_unknown_and_cmo_type_is_none or is_cmo_or_get_and_alias_types_equal )))
1267
+
1268
+
1269
+ def _is_wlst_read_type_compatible_list_type (attribute , lsa_type , wlst_read_type ):
1270
+ _method_name = '_is_wlst_read_type_compatible_list_type'
1271
+ _logger .entering (attribute , lsa_type , wlst_read_type , class_name = CLASS_NAME , method_name = _method_name )
1272
+
1273
+ result = False
1274
+ if wlst_read_type is not None and lsa_type is not None :
1275
+ # if the lsa_type is 'string' and the wlst_read_type is 'delimited_string[*]', the types are a match
1276
+ result = wlst_read_type in alias_constants .ALIAS_DELIMITED_TYPES and lsa_type in wlst_read_type
1277
+
1278
+ _logger .exiting (class_name = CLASS_NAME , method_name = _method_name , result = result )
1279
+ return result
1280
+
1281
+
1282
+ def _is_in_types_with_get_required (attribute , alias_types , attribute_info , get_required_attribute_list ):
1251
1283
lsa_type , get_type , cmo_type = _get_attribute_types (attribute_info )
1252
- return attribute in get_required_attribute_list and (get_type == alias_type or cmo_type == alias_type )
1284
+ return attribute in get_required_attribute_list and (get_type in alias_types or cmo_type in alias_types )
1253
1285
1254
1286
1255
1287
def _check_for_allowed_unknowns (location , generated_attribute , wlst_type , alias_type , generated_attr_info ,
0 commit comments