Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/src/main/python/wlsdeploy/aliases/alias_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
from wlsdeploy.aliases.alias_constants import STRING
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
from wlsdeploy.aliases.wlst_modes import WlstModes
from wlsdeploy.exception import exception_helper
from wlsdeploy.logging.platform_logger import PlatformLogger

Expand Down Expand Up @@ -61,6 +62,12 @@
_logger = PlatformLogger('wlsdeploy.aliases')
_windows_path_regex = re.compile(r'^[a-zA-Z]:[\\/].*')

# WARNING: DO NOT USE OUTSIDE OF THIS FILE!
#
# This variable gets set when the Aliases object is created so it will not be accurate
# unless/until the Aliases constructor completes successfully.
#
_wlst_mode = WlstModes.OFFLINE

def merge_model_and_existing_lists(model_list, existing_list, location_path="(unknown)", attribute_name="(unknown)"):
"""
Expand Down Expand Up @@ -428,6 +435,8 @@ def replace_tokens_in_path(location, path):
new_path = path
if name_tokens:
for key, value in name_tokens.iteritems():
if '/' in value and _wlst_mode == WlstModes.OFFLINE:
value = '(%s)' % value
new_path = new_path.replace('%s%s%s' % ('%', key, '%'), value)

missing_name_token = get_missing_name_tokens(new_path)
Expand Down
1 change: 1 addition & 0 deletions core/src/main/python/wlsdeploy/aliases/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __init__(self, model_context, wlst_mode=WlstModes.OFFLINE, wls_version=None,
self._alias_entries = AliasEntries(wlst_mode, self._wls_version)
self._production_mode_enabled = False
self._secure_mode_enabled = False
alias_utils._wlst_mode = wlst_mode

def set_production_mode(self, production_mode_enabled):
_method_name = 'set_production_mode'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def __add_shared_libraries(self):
shared_library_token = self.aliases.get_name_token(shared_library_location)

for shared_library_name in shared_libraries:
self.wlst_helper.cd(root_path) # avoid cd to pwd that may contain slashed names
existing_shared_libraries = deployer_utils.get_existing_object_list(shared_library_location, self.aliases)

if model_helper.is_delete_name(shared_library_name):
Expand Down Expand Up @@ -133,8 +134,8 @@ def __add_shared_libraries(self):

library_name = \
self.version_helper.get_library_versioned_name(shlib_source_path, shared_library_name)
quoted_library_name = self.wlst_helper.get_quoted_name_for_wlst(library_name)
shared_library_location.add_name_token(shared_library_token, quoted_library_name)
# names are quoted/escaped later, when paths are resolved
shared_library_location.add_name_token(shared_library_token, library_name)

self.wlst_helper.cd(root_path)
deployer_utils.create_and_cd(shared_library_location, existing_shared_libraries, self.aliases)
Expand Down Expand Up @@ -184,6 +185,7 @@ def __add_applications(self):
application_token = self.aliases.get_name_token(application_location)

for application_name in applications:
self.wlst_helper.cd(root_path) # avoid cd to pwd that may contain slashed names
existing_applications = deployer_utils.get_existing_object_list(application_location, self.aliases)

if model_helper.is_delete_name(application_name):
Expand Down Expand Up @@ -211,9 +213,8 @@ def __add_applications(self):
self.version_helper.get_application_versioned_name(app_source_path, application_name,
module_type=module_type)

quoted_application_name = self.wlst_helper.get_quoted_name_for_wlst(application_name)

application_location.add_name_token(application_token, quoted_application_name)
# names are quoted/escaped later, when paths are resolved
application_location.add_name_token(application_token, application_name)

self.wlst_helper.cd(root_path)
deployer_utils.create_and_cd(application_location, existing_applications, self.aliases)
Expand Down