16
16
from wlsdeploy .aliases .alias_constants import ALIAS_MAP_TYPES
17
17
from wlsdeploy .aliases .alias_constants import ATTRIBUTES
18
18
from wlsdeploy .aliases .alias_constants import ChildFoldersTypes
19
- from wlsdeploy .aliases .alias_constants import DEFAULT
19
+ from wlsdeploy .aliases .alias_constants import DEFAULT_VALUE
20
20
from wlsdeploy .aliases .alias_constants import FLATTENED_FOLDER_DATA
21
21
from wlsdeploy .aliases .alias_constants import FOLDERS
22
22
from wlsdeploy .aliases .alias_constants import GET
38
38
from wlsdeploy .aliases .alias_constants import SET_METHOD
39
39
from wlsdeploy .aliases .alias_constants import STRING
40
40
from wlsdeploy .aliases .alias_constants import USES_PATH_TOKENS
41
- from wlsdeploy .aliases .alias_constants import VALUE
42
41
from wlsdeploy .aliases .alias_constants import WLST_NAME
43
42
from wlsdeploy .aliases .alias_constants import WLST_READ_TYPE
44
43
from wlsdeploy .aliases .alias_constants import WLST_TYPE
@@ -990,20 +989,21 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
990
989
delimiter = delimiter )
991
990
992
991
model_attribute_name = attribute_info [MODEL_NAME ]
993
- default_value = attribute_info [VALUE ][ DEFAULT ]
992
+ default_value = attribute_info [DEFAULT_VALUE ]
994
993
995
994
#
996
995
# The logic below to compare the str() representation of the converted value and the default value
997
996
# only works for lists/maps if both the converted value and the default value are the same data type...
998
997
#
999
998
if (model_type in ALIAS_LIST_TYPES or model_type in ALIAS_MAP_TYPES ) \
1000
- and not (default_value == '[]' or default_value == ' None' ):
999
+ and not (default_value == '[]' or default_value is None ):
1001
1000
# always the model delimiter
1002
1001
default_value = alias_utils .convert_to_type (model_type , default_value ,
1003
1002
delimiter = MODEL_LIST_DELIMITER )
1004
1003
1005
1004
if attribute_info [WLST_TYPE ] == STRING :
1006
- default_value = alias_utils .replace_tokens_in_path (location , default_value )
1005
+ if default_value :
1006
+ default_value = alias_utils .replace_tokens_in_path (location , default_value )
1007
1007
1008
1008
if model_type == 'password' :
1009
1009
if string_utils .is_empty (wlst_attribute_value ) or converted_value == default_value :
@@ -1021,7 +1021,7 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
1021
1021
1022
1022
elif (model_type in ALIAS_LIST_TYPES or data_type in ALIAS_MAP_TYPES ) and \
1023
1023
(converted_value is None or len (converted_value ) == 0 ):
1024
- if default_value == '[]' or default_value == ' None' :
1024
+ if default_value == '[]' or default_value is None :
1025
1025
model_attribute_value = None
1026
1026
1027
1027
elif self ._model_context is not None and USES_PATH_TOKENS in attribute_info :
@@ -1031,6 +1031,10 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
1031
1031
model_attribute_value = self ._model_context .tokenize_classpath (converted_value )
1032
1032
if model_attribute_value == default_value :
1033
1033
model_attribute_value = None
1034
+
1035
+ elif default_value is None :
1036
+ model_attribute_value = converted_value
1037
+
1034
1038
elif str (converted_value ) != str (default_value ):
1035
1039
if _strings_are_empty (converted_value , default_value ):
1036
1040
model_attribute_value = None
@@ -1199,15 +1203,12 @@ def get_model_attribute_default_value(self, location, model_attribute_name):
1199
1203
default_value = None
1200
1204
attribute_info = self ._alias_entries .get_alias_attribute_entry_by_model_name (location , model_attribute_name )
1201
1205
if attribute_info is not None :
1202
- default_value = attribute_info [VALUE ][DEFAULT ]
1203
- if default_value == 'None' :
1204
- default_value = None
1205
- else :
1206
- data_type , delimiter = \
1207
- alias_utils .compute_read_data_type_and_delimiter_from_attribute_info (
1208
- attribute_info , default_value )
1206
+ default_value = attribute_info [DEFAULT_VALUE ]
1207
+ data_type , delimiter = \
1208
+ alias_utils .compute_read_data_type_and_delimiter_from_attribute_info (
1209
+ attribute_info , default_value )
1209
1210
1210
- default_value = alias_utils .convert_to_type (data_type , default_value , delimiter = delimiter )
1211
+ default_value = alias_utils .convert_to_type (data_type , default_value , delimiter = delimiter )
1211
1212
self ._logger .exiting (class_name = self ._class_name , method_name = _method_name , result = default_value )
1212
1213
return default_value
1213
1214
except AliasException , ae :
0 commit comments