@@ -555,7 +555,7 @@ def is_attribute_server_start_arguments(location, model_attribute_name):
555
555
:return: True if so, False otherwise
556
556
"""
557
557
return location .get_folder_path () == _server_start_location_folder_path and \
558
- model_attribute_name == _server_start_argument_attribute_name
558
+ model_attribute_name == _server_start_argument_attribute_name
559
559
560
560
561
561
def compute_delimiter_from_data_type (data_type , value ):
@@ -631,6 +631,8 @@ def convert_to_type(data_type, value, subtype=None, delimiter=None):
631
631
Convert the value to the specified type.
632
632
:param data_type: the type
633
633
:param value: the value
634
+ :param subtype: optional subtype for jarray type
635
+ :param delimiter: optional delimiter to use for parsing
634
636
:return: the value converted to the specified type
635
637
"""
636
638
_method_name = 'convert_to_type'
@@ -653,28 +655,33 @@ def convert_to_type(data_type, value, subtype=None, delimiter=None):
653
655
raise ex
654
656
655
657
if new_value is not None :
656
- if data_type == LONG :
657
- new_value = Long (new_value )
658
- elif data_type == JAVA_LANG_BOOLEAN :
659
- new_value = Boolean (new_value )
660
- elif data_type == JARRAY :
661
- if subtype is None or subtype == 'java.lang.String' :
662
- new_value = _create_string_array (new_value )
663
- else :
664
- new_value = _create_mbean_array (new_value , subtype )
665
- elif data_type == LIST :
666
- new_value = list (new_value )
667
- elif data_type in (COMMA_DELIMITED_STRING , DELIMITED_STRING , SEMI_COLON_DELIMITED_STRING ,
668
- SPACE_DELIMITED_STRING , PATH_SEPARATOR_DELIMITED_STRING ):
669
- #
670
- # This code intentionally ignores the delimiter value passed in and computes it from the data type.
671
- # This is required to handle the special case where the value we read from WLST might have a
672
- # different delimiter than the model value. In this use case, the value passed into the method
673
- # is the WLST value delimiter and the data_type is the preferred_model_type, so we compute the
674
- # model delimiter from the data_type directly.
675
- #
676
- delimiter = compute_delimiter_from_data_type (data_type , new_value )
677
- new_value = delimiter .join (new_value )
658
+ try :
659
+ if data_type == LONG :
660
+ new_value = Long (new_value )
661
+ elif data_type == JAVA_LANG_BOOLEAN :
662
+ new_value = Boolean (new_value )
663
+ elif data_type == JARRAY :
664
+ if subtype is None or subtype == 'java.lang.String' :
665
+ new_value = _create_string_array (new_value )
666
+ else :
667
+ new_value = _create_mbean_array (new_value , subtype )
668
+ elif data_type == LIST :
669
+ new_value = list (new_value )
670
+ elif data_type in (COMMA_DELIMITED_STRING , DELIMITED_STRING , SEMI_COLON_DELIMITED_STRING ,
671
+ SPACE_DELIMITED_STRING , PATH_SEPARATOR_DELIMITED_STRING ):
672
+ #
673
+ # This code intentionally ignores the delimiter value passed in and computes it from the data type.
674
+ # This is required to handle the special case where the value we read from WLST might have a
675
+ # different delimiter than the model value. In this use case, the value passed into the method
676
+ # is the WLST value delimiter and the data_type is the preferred_model_type, so we compute the
677
+ # model delimiter from the data_type directly.
678
+ #
679
+ delimiter = compute_delimiter_from_data_type (data_type , new_value )
680
+ new_value = delimiter .join (new_value )
681
+ except TypeError , te :
682
+ ex = exception_helper .create_alias_exception ('WLSDPLY-08021' , value , data_type , delimiter , te )
683
+ _logger .throwing (ex , class_name = _class_name , method_name = _method_name )
684
+ raise ex
678
685
679
686
return new_value
680
687
0 commit comments