Skip to content

Commit f6ce546

Browse files
committed
JIRA WDT-8 Convert WLST value to preferred type (if specified) in a single pass
1 parent 06d212e commit f6ce546

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

core/src/main/python/wlsdeploy/aliases/alias_utils.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
from wlsdeploy.aliases.alias_constants import WLST_TYPE
5353
from wlsdeploy.aliases.alias_constants import WLST_SUBFOLDERS_PATH
5454
from wlsdeploy.aliases.model_constants import ARGUMENTS
55-
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
5655
from wlsdeploy.aliases.model_constants import SERVER
5756
from wlsdeploy.aliases.model_constants import SERVER_START
5857

@@ -683,13 +682,10 @@ def convert_from_type(data_type, value, preferred=None, delimiter=None):
683682
elif value is not None and isinstance(value, ObjectName):
684683
new_value = value.getKeyProperty('Name')
685684
else:
686-
new_value = _jconvert_to_type(data_type, value, delimiter)
687-
685+
model_type = data_type
688686
if preferred:
689-
# now put it into the preferred model type, but the model delimiter should ALWAYS be the
690-
# model default delimiter
691-
delimiter = MODEL_LIST_DELIMITER
692-
new_value = _jconvert_to_type(preferred, new_value, delimiter)
687+
model_type = preferred
688+
new_value = _jconvert_to_type(model_type, value, delimiter)
693689

694690
return new_value
695691

core/src/test/python/alias_utils_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ def testWindowsPathSeparators(self):
108108
self.assertEqual(actual, expected)
109109
return
110110

111+
def testDelimitedListToList(self):
112+
value = 'one;two;three'
113+
actual = alias_utils.convert_from_type("invalid", value, preferred='list', delimiter=';')
114+
expected = ['one', 'two', 'three']
115+
lists_equal, message = self.__lists_are_equal(actual, expected)
116+
self.assertEqual(lists_equal, True, message)
117+
return
118+
111119
def __lists_are_equal(self, actual, expected):
112120
if actual is None and expected is None:
113121
return True, 'ok'

0 commit comments

Comments
 (0)