Skip to content

Commit 917b990

Browse files
authored
Issue #739 - Use name from manifest to deploy libraries onlien; use type name in logging (#741)
1 parent c54c8c3 commit 917b990

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,11 +1049,11 @@ WLSDPLY-09312=Stopping application {0} for update
10491049
WLSDPLY-09313=Starting application {0}
10501050
WLSDPLY-09314=Undeploying {0} {1} for update
10511051
WLSDPLY-09315=Redeploying application {0} because a shared library referenced has been updated
1052-
WLSDPLY-09316=Deploying application {0}
1053-
WLSDPLY-09317=The application or library named {0} cannot be deployed because the {1} attribute is not specified
1054-
WLSDPLY-09318={0} Source Path {1} does not exists
1055-
WLSDPLY-09319=The application {0} specified Plan Path {1} that does not exist
1056-
WLSDPLY-09320=Deploying application {0} with arguments {1}
1052+
WLSDPLY-09316=Deploying {0} {1}
1053+
WLSDPLY-09317={0} {1} cannot be deployed because the {2} attribute is not specified
1054+
WLSDPLY-09318={0} {1} Source Path {2} does not exists
1055+
WLSDPLY-09319={0} {1} specified Plan Path {2} that does not exist
1056+
WLSDPLY-09320=Deploying {0} {1} with arguments {2}
10571057
WLSDPLY-09321=Invalid Manifest found in processing shared library {0} at {1}: Extension-Name attribute \
10581058
specified with no value: {2}
10591059
WLSDPLY-09322=Invalid Manifest found in processing shared library {0} at {1}: Implementation-Version attribute \

0 commit comments

Comments
 (0)