@@ -488,7 +488,10 @@ def __extend_domain(self, domain_home):
488
488
# targets may have been inadvertently assigned when clusters were added
489
489
self .topology_helper .clear_jdbc_placeholder_targeting (jdbc_names )
490
490
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 )
492
495
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
493
496
return
494
497
@@ -570,7 +573,7 @@ def __extend_domain_with_select_template(self, domain_home):
570
573
# targets may have been inadvertently assigned when clusters were added
571
574
self .topology_helper .clear_jdbc_placeholder_targeting (jdbc_names )
572
575
573
- self .__apply_base_domain_config (topology_folder_list )
576
+ self .__apply_base_domain_config (topology_folder_list , delete = True )
574
577
575
578
self .logger .info ('WLSDPLY-12205' , self ._domain_name , domain_home ,
576
579
class_name = self .__class_name , method_name = _method_name )
@@ -579,7 +582,11 @@ def __extend_domain_with_select_template(self, domain_home):
579
582
self .logger .info ('WLSDPLY-12206' , self ._domain_name , domain_home ,
580
583
class_name = self .__class_name , method_name = _method_name )
581
584
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 )
583
590
self .__create_security_folder ()
584
591
585
592
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
@@ -612,38 +619,44 @@ def __update_domain(self):
612
619
self .wlst_helper .close_domain ()
613
620
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
614
621
615
- def __apply_base_domain_config (self , topology_folder_list ):
622
+ def __apply_base_domain_config (self , topology_folder_list , delete = True ):
616
623
"""
617
624
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
618
626
:param topology_folder_list: the model topology folder list to process
627
+ :param delete: If the pass will do deletes
619
628
:raises: CreateException: if an error occurs
620
629
"""
621
630
_method_name = '__apply_base_domain_config'
622
631
623
632
self .logger .entering (topology_folder_list , class_name = self .__class_name , method_name = _method_name )
624
633
self .logger .fine ('WLSDPLY-12219' , class_name = self .__class_name , method_name = _method_name )
625
634
635
+ topology_local_list = list (topology_folder_list )
626
636
location = LocationContext ()
627
637
domain_name_token = self .aliases .get_name_token (location )
628
638
location .add_name_token (domain_name_token , self ._domain_name )
629
639
630
- topology_folder_list .remove (SECURITY_CONFIGURATION )
640
+ topology_local_list .remove (SECURITY_CONFIGURATION )
631
641
632
642
self .__create_reliable_delivery_policy (location )
633
- topology_folder_list .remove (WS_RELIABLE_DELIVERY_POLICY )
643
+ topology_local_list .remove (WS_RELIABLE_DELIVERY_POLICY )
634
644
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,
636
646
# 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 )
647
660
648
661
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
649
662
return
0 commit comments