@@ -232,23 +232,16 @@ def __online_deploy_apps_and_libs(self, base_location):
232
232
# libraries to be undeployed
233
233
update_library_list = list ()
234
234
235
- # app targets to be deleted
236
- app_delete_targets = dict ()
237
-
238
- # library targets to be deleted
239
- lib_delete_targets = dict ()
240
-
241
235
lib_location = LocationContext (base_location ).append_location (LIBRARY )
242
236
# Go through the model libraries and find existing libraries that are referenced
243
237
# by applications and compute a processing strategy for each library.
244
238
self .__build_library_deploy_strategy (lib_location , model_shared_libraries , existing_lib_refs ,
245
- stop_app_list , update_library_list , stop_and_undeploy_app_list ,
246
- lib_delete_targets )
239
+ stop_app_list , update_library_list , stop_and_undeploy_app_list )
247
240
248
241
# Go through the model applications and compute the processing strategy for each application.
249
242
app_location = LocationContext (base_location ).append_location (APPLICATION )
250
243
self .__build_app_deploy_strategy (app_location , model_applications , existing_app_refs ,
251
- stop_and_undeploy_app_list , app_delete_targets )
244
+ stop_and_undeploy_app_list )
252
245
253
246
# deployed_app_list is list of apps that has been deployed and stareted again
254
247
# redeploy_app_list is list of apps that needs to be redeplyed
@@ -268,18 +261,6 @@ def __online_deploy_apps_and_libs(self, base_location):
268
261
self .__stop_app (app )
269
262
self .__undeploy_app (app )
270
263
271
- # targets were deleted from an app, so undeploy for those specific targets
272
- for app in app_delete_targets :
273
- delete_targets = app_delete_targets [app ]
274
- if delete_targets :
275
- self .__undeploy_app (app , targets = delete_targets )
276
-
277
- # targets were deleted from a library, so undeploy for those specific targets
278
- for lib in lib_delete_targets :
279
- delete_targets = lib_delete_targets [lib ]
280
- if delete_targets :
281
- self .__undeploy_app (lib , library_module = 'true' , targets = delete_targets )
282
-
283
264
# library is updated, it must be undeployed first
284
265
for lib in update_library_list :
285
266
self .__undeploy_app (lib , library_module = 'true' )
@@ -521,7 +502,7 @@ def __get_library_references(self, base_location):
521
502
return existing_libraries
522
503
523
504
def __build_library_deploy_strategy (self , location , model_libs , existing_lib_refs , stop_app_list ,
524
- update_library_list , stop_and_undeploy_app_list , lib_delete_targets ):
505
+ update_library_list , stop_and_undeploy_app_list ):
525
506
"""
526
507
Update maps and lists to control re-deployment processing.
527
508
:param location: the location of the libraries
@@ -530,7 +511,6 @@ def __build_library_deploy_strategy(self, location, model_libs, existing_lib_ref
530
511
:param stop_app_list: a list to update with dependent apps to be stopped and undeployed
531
512
:param update_library_list: a list to update with libraries to be stopped before deploying
532
513
:param stop_and_undeploy_app_list: a list to update with libraries to be stopped and undeployed
533
- :param lib_delete_targets: a map to update with delete targets for libraries
534
514
"""
535
515
_method_name = '__build_library_deploy_strategy'
536
516
@@ -563,9 +543,8 @@ def __build_library_deploy_strategy(self, location, model_libs, existing_lib_ref
563
543
564
544
existing_lib_ref = dictionary_utils .get_dictionary_element (existing_lib_refs , versioned_name )
565
545
566
- # collect the delete targets, and remove them from the model and existing targets
567
- lib_delete_targets [versioned_name ] = \
568
- self .__extract_delete_targets (lib_dict , existing_lib_ref , location , lib )
546
+ # remove deleted targets from the model and the existing library targets
547
+ self .__remove_delete_targets (lib_dict , existing_lib_ref )
569
548
570
549
if versioned_name in existing_libs :
571
550
# skipping absolute path libraries if they are the same
@@ -628,15 +607,13 @@ def __build_library_deploy_strategy(self, location, model_libs, existing_lib_ref
628
607
lib_dict ['SourcePath' ] = existing_src_path
629
608
return
630
609
631
- def __build_app_deploy_strategy (self , location , model_apps , existing_app_refs , stop_and_undeploy_app_list ,
632
- app_delete_targets ):
610
+ def __build_app_deploy_strategy (self , location , model_apps , existing_app_refs , stop_and_undeploy_app_list ):
633
611
"""
634
612
Update maps and lists to control re-deployment processing.
635
613
:param location: the location of the applications
636
614
:param model_apps: a copy of applications from the model, attributes may be revised
637
615
:param existing_app_refs: map of information about each existing app
638
616
:param stop_and_undeploy_app_list: a list to update with apps to be stopped and undeployed
639
- :param app_delete_targets: a map to update with delete targets for applications
640
617
"""
641
618
_method_name = '__build_app_deploy_strategy'
642
619
@@ -665,9 +642,8 @@ def __build_app_deploy_strategy(self, location, model_apps, existing_app_refs, s
665
642
666
643
existing_app_ref = dictionary_utils .get_dictionary_element (existing_app_refs , versioned_name )
667
644
668
- # collect the delete targets, and remove them from the model and existing targets
669
- app_delete_targets [versioned_name ] = \
670
- self .__extract_delete_targets (app_dict , existing_app_ref , location , app )
645
+ # remove deleted targets from the model and the existing app targets
646
+ self .__remove_delete_targets (app_dict , existing_app_ref )
671
647
672
648
if versioned_name in existing_apps :
673
649
# Compare the hashes of the domain's existing apps to the model's apps.
@@ -719,17 +695,13 @@ def __build_app_deploy_strategy(self, location, model_apps, existing_app_refs, s
719
695
stop_and_undeploy_app_list .append (versioned_name )
720
696
return
721
697
722
- def __extract_delete_targets (self , model_dict , existing_ref , location , name ):
698
+ def __remove_delete_targets (self , model_dict , existing_ref ):
723
699
"""
724
- Create a comma-separated list of targets to be deleted for an app or library.
725
- Remove those targets from the model and existing target dictionaries.
700
+ Remove deleted targets from the model and existing target dictionaries.
726
701
:param model_dict: the model dictionary for the app or library, may be modified
727
702
:param existing_ref: the existing dictionary for the app or library, may be modified
728
- :param location: the location of the app or library, for logging
729
- :param name: the name of the app or library, for logging
730
- :return: a comma-separated list of targets to be removed, empty string for no targets
731
703
"""
732
- _method_name = '__extract_delete_targets '
704
+ _method_name = '__remove_delete_targets '
733
705
734
706
model_targets = dictionary_utils .get_element (model_dict , TARGET )
735
707
model_targets = alias_utils .create_list (model_targets , 'WLSDPLY-08000' )
@@ -738,23 +710,15 @@ def __extract_delete_targets(self, model_dict, existing_ref, location, name):
738
710
if not existing_targets :
739
711
existing_targets = list ()
740
712
741
- delete_targets = []
742
713
model_targets_iterator = list (model_targets )
743
714
for model_target in model_targets_iterator :
744
715
if model_helper .is_delete_name (model_target ):
745
716
model_targets .remove (model_target )
746
717
target_name = model_helper .get_delete_item_name (model_target )
747
718
if target_name in existing_targets :
748
719
existing_targets .remove (target_name )
749
- delete_targets .append (target_name )
750
- else :
751
- location .add_name_token (self .aliases .get_name_token (location ), name )
752
- location_path = self .aliases .get_model_folder_path (location )
753
- self .logger .warning ('WLSDPLY-08022' , model_target , TARGET , location_path ,
754
- class_name = self ._class_name , method_name = _method_name )
755
720
756
721
model_dict [TARGET ] = "," .join (model_targets )
757
- return "," .join (delete_targets )
758
722
759
723
def __verify_delete_versioned_app (self , app , existing_apps , type = 'app' ):
760
724
"""
0 commit comments