16
16
from wlsdeploy .aliases .location_context import LocationContext
17
17
from wlsdeploy .aliases .model_constants import ABSOLUTE_SOURCE_PATH
18
18
from wlsdeploy .aliases .model_constants import APPLICATION
19
- from wlsdeploy .aliases .model_constants import APP_DEPLOYMENTS
20
19
from wlsdeploy .aliases .model_constants import DEPLOYMENT_ORDER
21
20
from wlsdeploy .aliases .model_constants import LIBRARY
22
21
from wlsdeploy .aliases .model_constants import PARTITION
@@ -215,6 +214,8 @@ def __online_deploy_apps_and_libs(self, base_location):
215
214
existing_libs = existing_lib_refs .keys ()
216
215
existing_apps = existing_app_refs .keys ()
217
216
217
+ # stop the app if the referenced shared library is newer or
218
+ # if the source path changes
218
219
stop_app_list = list ()
219
220
stop_and_undeploy_app_list = list ()
220
221
update_library_list = list ()
@@ -372,7 +373,8 @@ def __get_existing_apps(self, base_location):
372
373
373
374
self .wlst_helper .server_config ()
374
375
self .wlst_helper .cd (wlst_list_path )
375
- apps = self .wlst_helper .get_existing_object_list (APP_DEPLOYMENTS )
376
+ apps = self .wlst_helper .get_existing_object_list ()
377
+
376
378
self .wlst_helper .domain_runtime ()
377
379
#
378
380
# Cannot use ApplicationRuntime since it includes datasources as ApplicationRuntimes
@@ -388,7 +390,24 @@ def __get_existing_apps(self, base_location):
388
390
attributes_map = self .wlst_helper .lsa ()
389
391
absolute_sourcepath = attributes_map ['AbsoluteSourcePath' ]
390
392
absolute_planpath = attributes_map ['AbsolutePlanPath' ]
393
+
394
+ # There are case in application where absolute source path is not set but sourepath is
395
+ # if source path is not absolute then we need to add the domain path
396
+
397
+ if absolute_planpath is None :
398
+ absolute_planpath = attributes_map ['PlanPath' ]
399
+
400
+ if absolute_planpath is not None and not os .path .isabs (absolute_planpath ):
401
+ absolute_planpath = self .model_context .get_domain_home () + '/' + absolute_planpath
402
+
403
+ if absolute_sourcepath is None :
404
+ absolute_sourcepath = attributes_map ['SourcePath' ]
405
+
406
+ if absolute_sourcepath is not None and not os .path .isabs (absolute_sourcepath ):
407
+ absolute_sourcepath = self .model_context .get_domain_home () + '/' + absolute_sourcepath
408
+
391
409
deployment_order = attributes_map ['DeploymentOrder' ]
410
+
392
411
app_hash = self .__get_file_hash (absolute_sourcepath )
393
412
if absolute_planpath is not None :
394
413
plan_hash = self .__get_file_hash (absolute_planpath )
@@ -436,8 +455,16 @@ def __get_library_references(self, base_location):
436
455
config_attributes = self .wlst_helper .lsa ()
437
456
config_targets = self .__get_config_targets ()
438
457
439
- # TODO(jshum) - Why does the deployment plan not get considered?
458
+ # There are case in application where absolute source path is not set but sourepath is
459
+ # if source path is not absolute then we need to add the domain path
460
+
440
461
absolute_source_path = config_attributes [ABSOLUTE_SOURCE_PATH ]
462
+ if absolute_source_path is None :
463
+ absolute_source_path = config_attributes ['SourcePath' ]
464
+
465
+ if absolute_source_path is not None and not os .path .isabs (absolute_source_path ):
466
+ absolute_source_path = self .model_context .get_domain_home () + '/' + absolute_source_path
467
+
441
468
deployment_order = config_attributes [DEPLOYMENT_ORDER ]
442
469
lib_hash = self .__get_file_hash (absolute_source_path )
443
470
@@ -569,6 +596,8 @@ def __get_file_hash(self, filename):
569
596
_method_name = '__get_file_hash'
570
597
571
598
try :
599
+ if filename is None :
600
+ return None
572
601
hash_value = FileUtils .computeHash (filename )
573
602
except (IOException , NoSuchAlgorithmException ), e :
574
603
ex = exception_helper .create_deploy_exception ('WLSDPLY-09309' , filename , e .getLocalizedMessage (), error = e )
@@ -632,6 +661,10 @@ def __stop_app(self, application_name, partition_name=None, timeout=None):
632
661
progress = self .wlst_helper .stop_application (application_name , partition = partition_name , timeout = timeout )
633
662
while progress .isRunning ():
634
663
continue
664
+ if progress .isFailed ():
665
+ ex = exception_helper .create_deploy_exception ('WLSDPLY-09327' , application_name , progress .getMessage ())
666
+ self .logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
667
+ raise ex
635
668
return
636
669
637
670
def __start_app (self , application_name , partition_name = None ):
0 commit comments