@@ -343,78 +343,84 @@ def get_wlst_attribute_name_and_value(self, location, model_attribute_name, mode
343
343
wlst_attribute_value = None
344
344
345
345
module_folder = self ._alias_entries .get_dictionary_for_location (location )
346
- if ATTRIBUTES not in module_folder :
347
- ex = exception_helper .create_alias_exception ('WLSDPLY-08400' , location .get_folder_path ())
348
- self ._logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
349
- raise ex
350
-
351
- if model_attribute_name not in module_folder [ATTRIBUTES ]:
352
- ex = exception_helper .create_alias_exception ('WLSDPLY-08401' , model_attribute_name ,
353
- location .get_folder_path ())
354
- self ._logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
355
- raise ex
356
-
357
- attribute_info = module_folder [ATTRIBUTES ][model_attribute_name ]
358
-
359
- if attribute_info and not self .__is_model_attribute_read_only (location , attribute_info ):
360
- password_attribute_name = \
361
- password_utils .get_wlst_attribute_name (attribute_info , model_attribute_value , self ._wlst_mode )
346
+ if not module_folder :
347
+ self ._logger .fine ('WLSDPLY-08410' , location .get_current_model_folder (), location .get_parent_folder_path (),
348
+ WlstModes .from_value (self ._wlst_mode ), self ._wls_version )
349
+ else :
350
+ if ATTRIBUTES not in module_folder :
351
+ ex = exception_helper .create_alias_exception ('WLSDPLY-08400' , location .get_folder_path ())
352
+ self ._logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
353
+ raise ex
362
354
363
- if password_attribute_name is not None :
364
- wlst_attribute_name = password_attribute_name
365
- else :
366
- wlst_attribute_name = attribute_info [WLST_NAME ]
355
+ if model_attribute_name not in module_folder [ATTRIBUTES ]:
356
+ ex = exception_helper .create_alias_exception ('WLSDPLY-08401' , model_attribute_name ,
357
+ location .get_folder_path ())
358
+ self ._logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
359
+ raise ex
367
360
368
- if self ._model_context and USES_PATH_TOKENS in attribute_info and string_utils .to_boolean (attribute_info [USES_PATH_TOKENS ]):
369
- model_attribute_value = self ._model_context .replace_token_string (model_attribute_value )
361
+ attribute_info = module_folder [ATTRIBUTES ][model_attribute_name ]
370
362
371
- data_type = attribute_info [WLST_TYPE ]
372
- if data_type == 'password' :
373
- try :
374
- wlst_attribute_value = self .__decrypt_password (model_attribute_value )
375
- except EncryptionException , ee :
376
- ex = exception_helper .create_alias_exception ('WLSDPLY-08402' , model_attribute_name ,
377
- location .get_folder_path (),
378
- ee .getLocalizedMessage (), error = ee )
379
- self ._logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
380
- raise ex
381
- else :
382
- if data_type in ALIAS_LIST_TYPES or data_type in ALIAS_MAP_TYPES :
383
- merge = True
384
- if MERGE in attribute_info :
385
- merge = alias_utils .convert_boolean (attribute_info [MERGE ])
386
-
387
- if merge and data_type in ALIAS_MAP_TYPES :
388
- model_val = TypeUtils .convertToType (PROPERTIES , model_attribute_value )
389
- existing_val = TypeUtils .convertToType (PROPERTIES , existing_wlst_value )
390
- merged_value = alias_utils .merge_model_and_existing_properties (model_val , existing_val )
391
- elif merge and alias_utils .is_attribute_server_start_arguments (location , model_attribute_name ):
392
- merged_value = \
393
- alias_utils .merge_server_start_argument_values (model_attribute_value , existing_wlst_value )
394
- elif merge and existing_wlst_value is not None and len (existing_wlst_value ) > 0 :
395
- model_val = alias_utils .convert_to_type (LIST , model_attribute_value ,
396
- delimiter = MODEL_LIST_DELIMITER )
397
-
398
- _read_type , read_delimiter = \
399
- alias_utils .compute_read_data_type_and_delimiter_from_attribute_info (attribute_info ,
400
- existing_wlst_value )
401
- existing_val = alias_utils .convert_to_type (LIST , existing_wlst_value , delimiter = read_delimiter )
402
- merged_value = alias_utils .merge_model_and_existing_lists (model_val , existing_val )
403
- else :
404
- merged_value = model_attribute_value
363
+ if attribute_info and not self .__is_model_attribute_read_only (location , attribute_info ):
364
+ password_attribute_name = \
365
+ password_utils .get_wlst_attribute_name (attribute_info , model_attribute_value , self ._wlst_mode )
405
366
406
- if data_type == JARRAY :
407
- subtype = 'java.lang.String'
408
- if SET_MBEAN_TYPE in attribute_info :
409
- subtype = attribute_info [SET_MBEAN_TYPE ]
410
- wlst_attribute_value = alias_utils .convert_to_type (data_type , merged_value , subtype = subtype ,
411
- delimiter = MODEL_LIST_DELIMITER )
367
+ if password_attribute_name is not None :
368
+ wlst_attribute_name = password_attribute_name
369
+ else :
370
+ wlst_attribute_name = attribute_info [WLST_NAME ]
371
+
372
+ if self ._model_context and USES_PATH_TOKENS in attribute_info \
373
+ and string_utils .to_boolean (attribute_info [USES_PATH_TOKENS ]):
374
+ model_attribute_value = self ._model_context .replace_token_string (model_attribute_value )
375
+
376
+ data_type = attribute_info [WLST_TYPE ]
377
+ if data_type == 'password' :
378
+ try :
379
+ wlst_attribute_value = self .__decrypt_password (model_attribute_value )
380
+ except EncryptionException , ee :
381
+ ex = exception_helper .create_alias_exception ('WLSDPLY-08402' , model_attribute_name ,
382
+ location .get_folder_path (),
383
+ ee .getLocalizedMessage (), error = ee )
384
+ self ._logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
385
+ raise ex
386
+ else :
387
+ if data_type in ALIAS_LIST_TYPES or data_type in ALIAS_MAP_TYPES :
388
+ merge = True
389
+ if MERGE in attribute_info :
390
+ merge = alias_utils .convert_boolean (attribute_info [MERGE ])
391
+
392
+ if merge and data_type in ALIAS_MAP_TYPES :
393
+ model_val = TypeUtils .convertToType (PROPERTIES , model_attribute_value )
394
+ existing_val = TypeUtils .convertToType (PROPERTIES , existing_wlst_value )
395
+ merged_value = alias_utils .merge_model_and_existing_properties (model_val , existing_val )
396
+ elif merge and alias_utils .is_attribute_server_start_arguments (location , model_attribute_name ):
397
+ merged_value = alias_utils .merge_server_start_argument_values (model_attribute_value ,
398
+ existing_wlst_value )
399
+ elif merge and existing_wlst_value is not None and len (existing_wlst_value ) > 0 :
400
+ model_val = alias_utils .convert_to_type (LIST , model_attribute_value ,
401
+ delimiter = MODEL_LIST_DELIMITER )
402
+
403
+ _read_type , read_delimiter = \
404
+ alias_utils .compute_read_data_type_and_delimiter_from_attribute_info (attribute_info ,
405
+ existing_wlst_value )
406
+ existing_val = alias_utils .convert_to_type (LIST , existing_wlst_value ,
407
+ delimiter = read_delimiter )
408
+ merged_value = alias_utils .merge_model_and_existing_lists (model_val , existing_val )
409
+ else :
410
+ merged_value = model_attribute_value
411
+
412
+ if data_type == JARRAY :
413
+ subtype = 'java.lang.String'
414
+ if SET_MBEAN_TYPE in attribute_info :
415
+ subtype = attribute_info [SET_MBEAN_TYPE ]
416
+ wlst_attribute_value = alias_utils .convert_to_type (data_type , merged_value , subtype = subtype ,
417
+ delimiter = MODEL_LIST_DELIMITER )
418
+ else :
419
+ wlst_attribute_value = alias_utils .convert_to_type (data_type , merged_value ,
420
+ delimiter = MODEL_LIST_DELIMITER )
412
421
else :
413
- wlst_attribute_value = alias_utils .convert_to_type (data_type , merged_value ,
422
+ wlst_attribute_value = alias_utils .convert_to_type (data_type , model_attribute_value ,
414
423
delimiter = MODEL_LIST_DELIMITER )
415
- else :
416
- wlst_attribute_value = alias_utils .convert_to_type (data_type , model_attribute_value ,
417
- delimiter = MODEL_LIST_DELIMITER )
418
424
419
425
return wlst_attribute_name , wlst_attribute_value
420
426
0 commit comments