diff --git a/core/src/main/python/wlsdeploy/aliases/alias_utils.py b/core/src/main/python/wlsdeploy/aliases/alias_utils.py index 520a6dee23..485e9499e6 100644 --- a/core/src/main/python/wlsdeploy/aliases/alias_utils.py +++ b/core/src/main/python/wlsdeploy/aliases/alias_utils.py @@ -555,7 +555,7 @@ def is_attribute_server_start_arguments(location, model_attribute_name): :return: True if so, False otherwise """ return location.get_folder_path() == _server_start_location_folder_path and \ - model_attribute_name == _server_start_argument_attribute_name + model_attribute_name == _server_start_argument_attribute_name def compute_delimiter_from_data_type(data_type, value): @@ -631,6 +631,8 @@ def convert_to_type(data_type, value, subtype=None, delimiter=None): Convert the value to the specified type. :param data_type: the type :param value: the value + :param subtype: optional subtype for jarray type + :param delimiter: optional delimiter to use for parsing :return: the value converted to the specified type """ _method_name = 'convert_to_type' @@ -653,28 +655,33 @@ def convert_to_type(data_type, value, subtype=None, delimiter=None): raise ex if new_value is not None: - if data_type == LONG: - new_value = Long(new_value) - elif data_type == JAVA_LANG_BOOLEAN: - new_value = Boolean(new_value) - elif data_type == JARRAY: - if subtype is None or subtype == 'java.lang.String': - new_value = _create_string_array(new_value) - else: - new_value = _create_mbean_array(new_value, subtype) - elif data_type == LIST: - new_value = list(new_value) - elif data_type in (COMMA_DELIMITED_STRING, DELIMITED_STRING, SEMI_COLON_DELIMITED_STRING, - SPACE_DELIMITED_STRING, PATH_SEPARATOR_DELIMITED_STRING): - # - # This code intentionally ignores the delimiter value passed in and computes it from the data type. - # This is required to handle the special case where the value we read from WLST might have a - # different delimiter than the model value. In this use case, the value passed into the method - # is the WLST value delimiter and the data_type is the preferred_model_type, so we compute the - # model delimiter from the data_type directly. - # - delimiter = compute_delimiter_from_data_type(data_type, new_value) - new_value = delimiter.join(new_value) + try: + if data_type == LONG: + new_value = Long(new_value) + elif data_type == JAVA_LANG_BOOLEAN: + new_value = Boolean(new_value) + elif data_type == JARRAY: + if subtype is None or subtype == 'java.lang.String': + new_value = _create_string_array(new_value) + else: + new_value = _create_mbean_array(new_value, subtype) + elif data_type == LIST: + new_value = list(new_value) + elif data_type in (COMMA_DELIMITED_STRING, DELIMITED_STRING, SEMI_COLON_DELIMITED_STRING, + SPACE_DELIMITED_STRING, PATH_SEPARATOR_DELIMITED_STRING): + # + # This code intentionally ignores the delimiter value passed in and computes it from the data type. + # This is required to handle the special case where the value we read from WLST might have a + # different delimiter than the model value. In this use case, the value passed into the method + # is the WLST value delimiter and the data_type is the preferred_model_type, so we compute the + # model delimiter from the data_type directly. + # + delimiter = compute_delimiter_from_data_type(data_type, new_value) + new_value = delimiter.join(new_value) + except TypeError, te: + ex = exception_helper.create_alias_exception('WLSDPLY-08021', value, data_type, delimiter, te) + _logger.throwing(ex, class_name=_class_name, method_name=_method_name) + raise ex return new_value