Skip to content

Commit 8b113c5

Browse files
committed
Merge branch 'compare-app-targets' into 'main'
Include all targets when comparing apps and libraries See merge request weblogic-cloud/weblogic-deploy-tooling!1781
2 parents 6c42f87 + 99a0288 commit 8b113c5

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

core/src/main/python/wlsdeploy/tool/compare/model_comparer.py

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2+
Copyright (c) 2021, 2025, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
from java.util import Properties
@@ -456,13 +456,26 @@ def _finalize_folder(self, current_folder, past_folder, change_folder, location)
456456
if location is not None:
457457
folder_path = location.get_model_folders()
458458

459-
# Application and Library should include SourcePath if they have any other elements
459+
# Application and Library should include all attributes from past and change folders.
460+
# Changes to source path or underlying jar may require redeployment.
460461
if (len(folder_path) == 1) and (folder_path[0] in self.SOURCE_PATH_FOLDERS):
461-
# Handling Application and Library changes but keep the original that has not been changed
462462
if change_folder:
463-
orig_keys = dictionary_utils.get_dictionary_attributes(past_folder)
464-
for key in orig_keys:
465-
if key not in change_folder.keys():
466-
key_value = dictionary_utils.get_element(past_folder, key)
463+
past_keys = dictionary_utils.get_dictionary_attributes(past_folder)
464+
for past_key in past_keys:
465+
attribute_type = self._aliases.get_model_attribute_type(location, past_key)
466+
467+
if past_key not in change_folder.keys():
468+
key_value = dictionary_utils.get_element(past_folder, past_key)
467469
if key_value is not None:
468-
change_folder[key] = key_value
470+
change_folder[past_key] = key_value
471+
472+
elif attribute_type in ALIAS_LIST_TYPES: # update list with past + change items (ex: Target)
473+
past_list = alias_utils.create_list(past_folder[past_key], 'WLSDPLY-08001')
474+
change_list = alias_utils.create_list(change_folder[past_key], 'WLSDPLY-08000')
475+
new_list = list()
476+
for past_item in past_list:
477+
past_delete_item = model_helper.get_delete_name(past_item)
478+
if past_item not in change_list and past_delete_item not in change_list:
479+
new_list.append(past_item)
480+
new_list.extend(change_list)
481+
change_folder[past_key] = ','.join(new_list)

0 commit comments

Comments
 (0)