@@ -1010,25 +1010,49 @@ def __get_mt_names_from_location(self, app_location):
1010
1010
1011
1011
def __deploy_app_online (self , application_name , source_path , targets , plan = None , partition = None ,
1012
1012
resource_group = None , resource_group_template = None , options = None ):
1013
+ """
1014
+ Deploy an application or shared library in online mode.
1015
+ :param application_name: the name of the app or library from the model
1016
+ :param source_path: the source path of the app or library
1017
+ :param targets: the intended targets
1018
+ :param plan: optional, the path to the plan
1019
+ :param partition: optional, the partition
1020
+ :param resource_group: optional, the resource group
1021
+ :param resource_group_template: optional, the resource group template
1022
+ :param options: optional, extra options for the WLST deploy() call
1023
+ """
1013
1024
_method_name = '__deploy_app_online'
1014
1025
1015
- self .logger .info ('WLSDPLY-09316' , application_name , class_name = self ._class_name , method_name = _method_name )
1026
+ is_library = False
1027
+ if options is not None :
1028
+ is_library = dictionary_utils .get_element (options , 'libraryModule' ) == 'true'
1029
+
1030
+ type_name = APPLICATION
1031
+ if is_library :
1032
+ type_name = LIBRARY
1033
+
1034
+ self .logger .info ('WLSDPLY-09316' , type_name , application_name , class_name = self ._class_name ,
1035
+ method_name = _method_name )
1016
1036
1017
1037
if string_utils .is_empty (source_path ):
1018
- ex = exception_helper .create_deploy_exception ('WLSDPLY-09317' , application_name , SOURCE_PATH )
1038
+ ex = exception_helper .create_deploy_exception ('WLSDPLY-09317' , type_name , application_name , SOURCE_PATH )
1019
1039
self .logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
1020
1040
raise ex
1021
1041
1022
1042
if not os .path .isabs (source_path ):
1023
1043
source_path = self .model_context .get_domain_home () + '/' + source_path
1024
1044
1025
1045
if not os .path .exists (source_path ):
1026
- ex = exception_helper .create_deploy_exception ('WLSDPLY-09318' , application_name , str (source_path ))
1046
+ ex = exception_helper .create_deploy_exception ('WLSDPLY-09318' , type_name , application_name ,
1047
+ str (source_path ))
1027
1048
self .logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
1028
1049
raise ex
1029
1050
1030
- # if options is not None and 'libraryModule' in options and string_utils.to_boolean(options['libraryModule']):
1031
- computed_name = self .__get_deployable_application_versioned_name (source_path , application_name )
1051
+ if is_library :
1052
+ computed_name = self .__get_deployable_library_versioned_name (source_path , application_name )
1053
+ else :
1054
+ computed_name = self .__get_deployable_application_versioned_name (source_path , application_name )
1055
+
1032
1056
application_name = computed_name
1033
1057
1034
1058
# build the dictionary of named arguments to pass to the deploy_application method
@@ -1039,7 +1063,7 @@ def __deploy_app_online(self, application_name, source_path, targets, plan=None,
1039
1063
plan = self .model_context .get_domain_home () + '/' + plan
1040
1064
1041
1065
if not os .path .exists (plan ):
1042
- ex = exception_helper .create_deploy_exception ('WLSDPLY-09319' , application_name , plan )
1066
+ ex = exception_helper .create_deploy_exception ('WLSDPLY-09319' , type_name , application_name , plan )
1043
1067
self .logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
1044
1068
raise ex
1045
1069
kwargs ['planPath' ] = str (plan )
@@ -1054,7 +1078,7 @@ def __deploy_app_online(self, application_name, source_path, targets, plan=None,
1054
1078
kwargs [key ] = value
1055
1079
kwargs ['timeout' ] = self .model_context .get_model_config ().get_deploy_timeout ()
1056
1080
1057
- self .logger .fine ('WLSDPLY-09320' , application_name , kwargs ,
1081
+ self .logger .fine ('WLSDPLY-09320' , type_name , application_name , kwargs ,
1058
1082
class_name = self ._class_name , method_name = _method_name )
1059
1083
self .wlst_helper .deploy_application (application_name , * args , ** kwargs )
1060
1084
return application_name
0 commit comments