Skip to content

Commit 5e65256

Browse files
authored
Merge pull request #277 from oracle/issue-275-splitting-classpath
Issue #275 - Join discovered lists using comma delimiter only; split …
2 parents 9d754d3 + f3ff941 commit 5e65256

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

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

+14-6
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,12 @@ def get_number_of_directories_to_strip(desired_path_type, actual_path_type):
663663

664664
def convert_from_type(data_type, value, preferred=None, delimiter=None):
665665
"""
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
666+
Convert WLST value to model representation type
667+
:param data_type: the target data type for the model
668+
:param value: value to be converted
669+
:param preferred: the preferred data type to be represented in the model (optional)
670+
:param delimiter: the delimiter for parsing the WLST representation of the data value (optional)
671+
:return: converted value
672672
"""
673673

674674
_method_name = 'convert_from_type'
@@ -835,6 +835,14 @@ def get_dictionary_mode(alias_dict):
835835

836836

837837
def _jconvert_to_type(data_type, value, delimiter):
838+
"""
839+
Convert WLST value to model representation type.
840+
Assumes that empty values and password data types have been converted elsewhere.
841+
:param data_type: the target data type for the model
842+
:param value: value to be converted
843+
:param delimiter: the delimiter for parsing the WLST representation of the data value (optional)
844+
:return: converted value
845+
"""
838846
_method_name = '_jconvert_to_type'
839847
try:
840848
converted = TypeUtils.convertToType(data_type, value, delimiter)

core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from wlsdeploy.aliases import model_constants
1515
from wlsdeploy.aliases.location_context import LocationContext
16+
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
1617
from wlsdeploy.aliases.wlst_modes import WlstModes
1718
from wlsdeploy.exception import exception_helper
1819
from wlsdeploy.logging.platform_logger import PlatformLogger
@@ -296,7 +297,7 @@ def discover_security_configuration(self):
296297
self._discover_subfolders(result, location)
297298
except DiscoverException, de:
298299
_logger.warning('WLSDPLY-06200', self._wls_version, de.getLocalizedMessage(),
299-
class_name=_class_name, method_name=_method_name)
300+
class_name=_class_name, method_name=_method_name)
300301
result = OrderedDict()
301302
_logger.exiting(class_name=_class_name, method_name=_method_name)
302303
return model_top_folder_name, result
@@ -532,18 +533,25 @@ def _add_classpath_libraries_to_archive(self, model_name, model_value, location)
532533
_method_name = 'add_classpath_libraries_to_archive'
533534
server_name = self._get_server_name_from_location(location)
534535
_logger.entering(server_name, model_name, model_value, class_name=_class_name, method_name=_method_name)
536+
535537
classpath_string = None
536538
if not StringUtils.isEmpty(model_value):
537-
classpath_list = []
538-
classpath_entries, separator = path_utils.split_classpath(model_value)
539+
classpath = path_utils.fixup_path(model_value)
540+
541+
# model values are comma-separated
542+
classpath_entries = classpath.split(MODEL_LIST_DELIMITER)
543+
539544
if classpath_entries:
545+
classpath_list = []
540546
for classpath_entry in classpath_entries:
541547
new_source_name = self._add_library(server_name, classpath_entry)
542548
if new_source_name is not None:
543549
classpath_list.append(new_source_name)
544-
classpath_string = StringUtils.getStringFromList(classpath_list, separator)
550+
551+
classpath_string = StringUtils.getStringFromList(classpath_list, MODEL_LIST_DELIMITER)
545552
_logger.fine('WLSDPLY-06617', server_name, classpath_string, class_name=_class_name,
546553
method_name=_method_name)
554+
547555
_logger.exiting(class_name=_class_name, method_name=_method_name, result=classpath_string)
548556
return classpath_string
549557

core/src/main/python/wlsdeploy/tool/validate/validator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ def __validate_path_tokens_attribute(self, attribute_name, attribute_value, mode
886886
if value_data_type == 'string' and model_constants.MODEL_LIST_DELIMITER in attribute_value:
887887
attr_values = attribute_value.split(model_constants.MODEL_LIST_DELIMITER)
888888

889-
if value_data_type == 'string':
889+
elif value_data_type == 'string':
890890
attr_values.append(attribute_value)
891891

892892
for item_path in attr_values:

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Server.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@
938938
"Arguments": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Arguments", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "delimited_string[space]" } ],
939939
"BeaHome": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "BeaHome", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true"} ],
940940
"BootProperties": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "BootProperties", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "properties", "get_method": "GET", "preferred_model_type": "list", "access": "RO"} ],
941-
"ClassPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ClassPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "delimited_string[path_separator]", "uses_path_tokens": "true"} ],
941+
"ClassPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ClassPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "delimited_string[path_separator]", "preferred_model_type": "delimited_string", "uses_path_tokens": "true"} ],
942942
"JavaHome": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JavaHome", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true"} ],
943943
"JavaVendor": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JavaVendor", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
944944
"MaxRestartCount": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "MaxRestartCount", "wlst_path": "WP001", "value": {"default": 0 }, "wlst_type": "integer" } ],

0 commit comments

Comments
 (0)