Skip to content

Commit 53c2fa4

Browse files
committed
Split model classpath using comma delimiter for discover and variable injector
1 parent 9f99162 commit 53c2fa4

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

core/src/main/python/wlsdeploy/util/model_context.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
import copy
77
import os
8+
import re
89
import tempfile
910

1011
import java.net.URI as URI
1112

1213
from oracle.weblogic.deploy.util import XPathUtil
14+
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
1315
from wlsdeploy.aliases.wlst_modes import WlstModes
1416
from wlsdeploy.logging import platform_logger
1517
from wlsdeploy.util import validate_configuration
@@ -898,14 +900,17 @@ def tokenize_classpath(self, classpath):
898900
"""
899901
Replace known types of directories with a tokens that represent the directory.
900902
901-
:param classpath: containing a string of directories separated by environment specific classpath separator
903+
:param classpath: containing a string of directories separated by commas
902904
:return: tokenized classpath string
903905
"""
904-
cp_elements, separator = path_utils.split_classpath(classpath)
906+
cp_elements = classpath.split(MODEL_LIST_DELIMITER)
905907
for index, value in enumerate(cp_elements):
908+
path_is_windows = '\\' in value or re.match('^[a-zA-Z][:]', value)
909+
if path_is_windows:
910+
value = path_utils.fixup_path(value)
906911
cp_elements[index] = self.tokenize_path(value)
907912

908-
return separator.join(cp_elements)
913+
return MODEL_LIST_DELIMITER.join(cp_elements)
909914

910915
def copy(self, arg_map):
911916
model_context_copy = copy.copy(self)

core/src/main/python/wlsdeploy/util/path_utils.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""
2-
Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import os
6-
import re
76

87
import java.io.File as JFile
98

@@ -17,28 +16,6 @@
1716
_class_name = 'path_utils'
1817

1918

20-
def split_classpath(classpath):
21-
"""
22-
Split the classpath string into a list of classpath directories. The classpath string will be split around
23-
the environment specific file separator token.
24-
:param classpath: string of token separated directories and files representing the classpath
25-
:return: list of classpath nodes
26-
"""
27-
classpath_is_windows = False
28-
# This is not a definitive test but it tests the cases we care about...
29-
if '\\' in classpath or ';' in classpath or re.match('^[a-zA-Z][:]', classpath):
30-
classpath_is_windows = True
31-
32-
if classpath_is_windows:
33-
my_classpath = fixup_path(classpath)
34-
separator = ';'
35-
else:
36-
my_classpath = classpath
37-
separator = ':'
38-
39-
return my_classpath.split(separator), separator
40-
41-
4219
def fixup_path(path):
4320
"""
4421
Standardize the path, replacing the back slashes with forward slash. This is more suitable for wlst

0 commit comments

Comments
 (0)