35
35
from wlsdeploy .aliases .alias_constants import JAVA_LANG_BOOLEAN
36
36
from wlsdeploy .aliases .alias_constants import LIST
37
37
from wlsdeploy .aliases .alias_constants import LONG
38
+ from wlsdeploy .aliases .model_constants import MODEL_LIST_DELIMITER
38
39
from wlsdeploy .aliases .alias_constants import PATH_SEPARATOR_DELIMITED_STRING
39
40
from wlsdeploy .aliases .alias_constants import PREFERRED_MODEL_TYPE
40
41
from wlsdeploy .aliases .alias_constants import SECURITY_PROVIDER_FOLDER_PATHS
@@ -663,12 +664,12 @@ def get_number_of_directories_to_strip(desired_path_type, actual_path_type):
663
664
664
665
def convert_from_type (data_type , value , preferred = None , delimiter = None ):
665
666
"""
666
- Convert from wlst type
667
- :param data_type: type of data
668
- :param value: value of data
669
- :param preferred: how it should be represented
670
- :param delimiter: for representation
671
- :return: converted type
667
+ Convert WLST value to model representation type
668
+ :param data_type: the target data type for the model
669
+ :param value: value to be converted
670
+ :param preferred: the preferred data type to be represented in the model (optional)
671
+ :param delimiter: the delimiter for parsing the WLST representation of the data value (optional)
672
+ :return: converted value
672
673
"""
673
674
674
675
_method_name = 'convert_from_type'
@@ -835,6 +836,14 @@ def get_dictionary_mode(alias_dict):
835
836
836
837
837
838
def _jconvert_to_type (data_type , value , delimiter ):
839
+ """
840
+ Convert WLST value to model representation type.
841
+ Assumes that empty values and password data types have been converted elsewhere.
842
+ :param data_type: the target data type for the model
843
+ :param value: value to be converted
844
+ :param delimiter: the delimiter for parsing the WLST representation of the data value (optional)
845
+ :return: converted value
846
+ """
838
847
_method_name = '_jconvert_to_type'
839
848
try :
840
849
converted = TypeUtils .convertToType (data_type , value , delimiter )
@@ -857,15 +866,11 @@ def _jconvert_to_type(data_type, value, delimiter):
857
866
elif data_type in (COMMA_DELIMITED_STRING , DELIMITED_STRING , SEMI_COLON_DELIMITED_STRING ,
858
867
SPACE_DELIMITED_STRING , PATH_SEPARATOR_DELIMITED_STRING ):
859
868
#
860
- # This code intentionally ignores the delimiter value passed in and computes it from the data type.
861
- # This is required to handle the special case where the value we read from WLST might have a
862
- # different delimiter than the model value. In this use case, the value passed into the method
863
- # is the WLST value delimiter and the data_type is the preferred_model_type, so we compute the
864
- # model delimiter from the data_type directly.
869
+ # Data type value may be the wlst_type, wlst_read_type, or the preferred_model_type from the alias
870
+ # definition. For any of these, the representation in the model should be comma-separated string.
865
871
#
866
- delimiter = compute_delimiter_from_data_type (data_type , converted )
867
- if delimiter and converted :
868
- converted = delimiter .join (converted )
872
+ if converted :
873
+ converted = MODEL_LIST_DELIMITER .join (converted )
869
874
except TypeError , te :
870
875
ex = exception_helper .create_alias_exception ('WLSDPLY-08021' , value , data_type , delimiter , str (te ))
871
876
_logger .throwing (ex , class_name = _class_name , method_name = _method_name )
0 commit comments