Skip to content

Commit cd728d4

Browse files
authored
Fix online update case is a sparse model is provided for changing app depployments target without source path specified. (#738)
1 parent 521afb2 commit cd728d4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,11 @@ def __build_library_deploy_strategy(self, location, model_libs, existing_lib_ref
592592

593593
targets_not_changed = existing_lib_targets_set == model_targets_set
594594
existing_src_path = dictionary_utils.get_element(existing_lib_ref, 'sourcePath')
595+
# For update case, the sparse model may be just changing targets, therefore without sourcepath
596+
597+
if model_src_path is None and existing_src_path is not None:
598+
model_src_path = existing_src_path
599+
595600
#
596601
# If the library is a WebLogic-distributed shared library and
597602
# the targets are the same then no need to deploy.
@@ -613,6 +618,9 @@ def __build_library_deploy_strategy(self, location, model_libs, existing_lib_ref
613618
#
614619
union_targets_set = existing_lib_targets_set.union(model_targets_set)
615620
lib_dict['Target'] = ','.join(union_targets_set)
621+
# For update case, the sparse model may be just changing targets, therefore without sourcepath
622+
if lib_dict['SourcePath'] is None and existing_src_path is not None:
623+
lib_dict['SourcePath'] = existing_src_path
616624

617625
_add_ref_apps_to_stoplist(stop_app_list, existing_lib_refs, lib)
618626
update_library_list.append(lib)
@@ -627,6 +635,9 @@ def __build_library_deploy_strategy(self, location, model_libs, existing_lib_ref
627635
adjusted_set = model_targets_set.difference(existing_lib_targets_set)
628636
adjusted_targets = ','.join(adjusted_set)
629637
lib_dict['Target'] = adjusted_targets
638+
# For update case, the sparse model may be just changing targets, therefore without sourcepath
639+
if lib_dict['SourcePath'] is None and existing_src_path is not None:
640+
lib_dict['SourcePath'] = existing_src_path
630641
return
631642

632643
def __build_app_deploy_strategy(self, location, model_apps, existing_app_refs, stop_and_undeploy_app_list,
@@ -675,6 +686,11 @@ def __build_app_deploy_strategy(self, location, model_apps, existing_app_refs, s
675686

676687
model_src_path = dictionary_utils.get_element(app_dict, SOURCE_PATH)
677688

689+
# For update case, the sparse model may be just changing targets, therefore without sourcepath
690+
691+
if model_src_path is None and src_path is not None:
692+
model_src_path = src_path
693+
678694
# check for exploded app in archive
679695
if (model_src_path is not None) and deployer_utils.is_path_into_archive(model_src_path) \
680696
and self.archive_helper.contains_path(model_src_path):
@@ -705,6 +721,11 @@ def __build_app_deploy_strategy(self, location, model_apps, existing_app_refs, s
705721
adjusted_set = model_targets_set.difference(existing_app_targets_set)
706722
adjusted_targets = ','.join(adjusted_set)
707723
app_dict['Target'] = adjusted_targets
724+
725+
# For update case, the sparse model may be just changing targets, therefore without sourcepath
726+
727+
if app_dict['SourcePath'] is None and src_path is not None:
728+
app_dict['SourcePath'] = src_path
708729
else:
709730
# updated deployment plan
710731
stop_and_undeploy_app_list.append(app)

0 commit comments

Comments
 (0)