Skip to content

Commit 9e69002

Browse files
Wdt 983 third pass of updates (#1115)
* temporary change * third pass of topology attributes * third pass of topology attributes * third pass of topology attributes
1 parent 46a3671 commit 9e69002

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,10 @@ def __extend_domain(self, domain_home):
488488
# targets may have been inadvertently assigned when clusters were added
489489
self.topology_helper.clear_jdbc_placeholder_targeting(jdbc_names)
490490

491-
self.__apply_base_domain_config(topology_folder_list)
491+
# This is a second pass. We will not do a third pass after extend templates
492+
# as it would require a updatedomain and reopen. If reported, revisit this
493+
# known issue
494+
self.__apply_base_domain_config(topology_folder_list, delete=True)
492495
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
493496
return
494497

@@ -570,7 +573,7 @@ def __extend_domain_with_select_template(self, domain_home):
570573
# targets may have been inadvertently assigned when clusters were added
571574
self.topology_helper.clear_jdbc_placeholder_targeting(jdbc_names)
572575

573-
self.__apply_base_domain_config(topology_folder_list)
576+
self.__apply_base_domain_config(topology_folder_list, delete=True)
574577

575578
self.logger.info('WLSDPLY-12205', self._domain_name, domain_home,
576579
class_name=self.__class_name, method_name=_method_name)
@@ -579,7 +582,11 @@ def __extend_domain_with_select_template(self, domain_home):
579582
self.logger.info('WLSDPLY-12206', self._domain_name, domain_home,
580583
class_name=self.__class_name, method_name=_method_name)
581584
self.wlst_helper.read_domain(domain_home)
582-
585+
# Third pass will perform No deletes, set the attributes again.This will address the
586+
# problem where a template's final.py overwrites attributes during the
587+
# write domain. This will allow the model value to take precedence over the final.py
588+
if len(extension_templates) > 0:
589+
self.__apply_base_domain_config(topology_folder_list, delete=False)
583590
self.__create_security_folder()
584591

585592
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
@@ -612,38 +619,44 @@ def __update_domain(self):
612619
self.wlst_helper.close_domain()
613620
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
614621

615-
def __apply_base_domain_config(self, topology_folder_list):
622+
def __apply_base_domain_config(self, topology_folder_list, delete=True):
616623
"""
617624
Apply the base domain configuration from the model topology section.
625+
This will be done in pass two and three of dealing with topology objects
618626
:param topology_folder_list: the model topology folder list to process
627+
:param delete: If the pass will do deletes
619628
:raises: CreateException: if an error occurs
620629
"""
621630
_method_name = '__apply_base_domain_config'
622631

623632
self.logger.entering(topology_folder_list, class_name=self.__class_name, method_name=_method_name)
624633
self.logger.fine('WLSDPLY-12219', class_name=self.__class_name, method_name=_method_name)
625634

635+
topology_local_list = list(topology_folder_list)
626636
location = LocationContext()
627637
domain_name_token = self.aliases.get_name_token(location)
628638
location.add_name_token(domain_name_token, self._domain_name)
629639

630-
topology_folder_list.remove(SECURITY_CONFIGURATION)
640+
topology_local_list.remove(SECURITY_CONFIGURATION)
631641

632642
self.__create_reliable_delivery_policy(location)
633-
topology_folder_list.remove(WS_RELIABLE_DELIVERY_POLICY)
643+
topology_local_list.remove(WS_RELIABLE_DELIVERY_POLICY)
634644

635-
# this second pass will re-establish any attributes that were changed by templates,
645+
# the second pass will re-establish any attributes that were changed by templates,
636646
# and process deletes and re-adds of named elements in the model order.
637-
self.__create_machines_clusters_and_servers()
638-
topology_folder_list.remove(MACHINE)
639-
topology_folder_list.remove(UNIX_MACHINE)
640-
topology_folder_list.remove(CLUSTER)
641-
if SERVER_TEMPLATE in topology_folder_list:
642-
topology_folder_list.remove(SERVER_TEMPLATE)
643-
topology_folder_list.remove(SERVER)
644-
topology_folder_list.remove(MIGRATABLE_TARGET)
645-
#
646-
self.__create_other_domain_artifacts(location, topology_folder_list)
647+
# the third pass will re-establish any attributes that were changed by templates, but will
648+
# not perform any deletes. re-adds will occur if for some reason they had an add with a delete
649+
# after, but this is not a scenario we are considering
650+
self.__create_machines_clusters_and_servers(delete_now=delete)
651+
topology_local_list.remove(MACHINE)
652+
topology_local_list.remove(UNIX_MACHINE)
653+
topology_local_list.remove(CLUSTER)
654+
if SERVER_TEMPLATE in topology_local_list:
655+
topology_local_list.remove(SERVER_TEMPLATE)
656+
topology_local_list.remove(SERVER)
657+
topology_local_list.remove(MIGRATABLE_TARGET)
658+
659+
self.__create_other_domain_artifacts(location, topology_local_list)
647660

648661
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
649662
return

0 commit comments

Comments
 (0)