@@ -1010,25 +1010,49 @@ def __get_mt_names_from_location(self, app_location):
10101010
10111011 def __deploy_app_online (self , application_name , source_path , targets , plan = None , partition = None ,
10121012 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+ """
10131024 _method_name = '__deploy_app_online'
10141025
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 )
10161036
10171037 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 )
10191039 self .logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
10201040 raise ex
10211041
10221042 if not os .path .isabs (source_path ):
10231043 source_path = self .model_context .get_domain_home () + '/' + source_path
10241044
10251045 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 ))
10271048 self .logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
10281049 raise ex
10291050
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+
10321056 application_name = computed_name
10331057
10341058 # 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,
10391063 plan = self .model_context .get_domain_home () + '/' + plan
10401064
10411065 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 )
10431067 self .logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
10441068 raise ex
10451069 kwargs ['planPath' ] = str (plan )
@@ -1054,7 +1078,7 @@ def __deploy_app_online(self, application_name, source_path, targets, plan=None,
10541078 kwargs [key ] = value
10551079 kwargs ['timeout' ] = self .model_context .get_model_config ().get_deploy_timeout ()
10561080
1057- self .logger .fine ('WLSDPLY-09320' , application_name , kwargs ,
1081+ self .logger .fine ('WLSDPLY-09320' , type_name , application_name , kwargs ,
10581082 class_name = self ._class_name , method_name = _method_name )
10591083 self .wlst_helper .deploy_application (application_name , * args , ** kwargs )
10601084 return application_name
0 commit comments