Skip to content

Commit a2ba9b3

Browse files
authored
Merge pull request #243 from oracle/online-deploy-fix
Fix __get_deployable_library_versioned_name to handle MANIFEST with W…
2 parents 95743c4 + 14f1d5c commit a2ba9b3

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,11 +702,11 @@ def __deploy_model_applications(self, model_apps, app_location, deployed_applist
702702
resource_group_template_name, resource_group_name, partition_name = \
703703
self.__get_mt_names_from_location(location)
704704

705-
self.__deploy_app_online(app_name, src_path, targets, plan=plan_file,
705+
new_app_name = self.__deploy_app_online(app_name, src_path, targets, plan=plan_file,
706706
partition=partition_name, resource_group=resource_group_name,
707707
resource_group_template=resource_group_template_name, options=options)
708708
location.remove_name_token(token_name)
709-
deployed_applist.append(app_name)
709+
deployed_applist.append(new_app_name)
710710
return
711711

712712
def __get_mt_names_from_location(self, app_location):
@@ -778,7 +778,7 @@ def __deploy_app_online(self, application_name, source_path, targets, plan=None,
778778
self.logger.fine('WLSDPLY-09320', application_name, kwargs,
779779
class_name=self._class_name, method_name=_method_name)
780780
self.wlst_helper.deploy_application(application_name, *args, **kwargs)
781-
return
781+
return application_name
782782

783783
def __extract_file_from_archive(self, path):
784784
if path is not None and deployer_utils.is_path_into_archive(path):
@@ -812,6 +812,13 @@ def __get_deployable_library_versioned_name(self, source_path, model_name):
812812
manifest = bao.toString('UTF-8')
813813
tokens = manifest.split()
814814

815+
# this is specific to application not shared library, so just returns it
816+
817+
if 'Weblogic-Application-Version:' in tokens:
818+
weblogic_appname_index = tokens.index('Weblogic-Application-Version:')
819+
versioned_name = old_name_tuple[self._EXTENSION_INDEX] + '#' + tokens[weblogic_appname_index+1]
820+
return versioned_name
821+
815822
if 'Extension-Name:' in tokens:
816823
extension_index = tokens.index('Extension-Name:')
817824
if len(tokens) > extension_index:
@@ -842,6 +849,9 @@ def __get_deployable_library_versioned_name(self, source_path, model_name):
842849
ex = exception_helper.create_deploy_exception('WLSDPLY-09323', model_name, source_path, tokens)
843850
self.logger.throwing(ex, class_name=self._class_name, method_name=_method_name)
844851
raise ex
852+
853+
854+
845855
self.logger.info('WLSDPLY-09324', model_name, versioned_name,
846856
class_name=self._class_name, method_name=_method_name)
847857
except (IOException, FileNotFoundException, ZipException, IllegalStateException), e:

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,7 @@ def get_library_name_components(name, wlst_mode=WlstModes.OFFLINE):
284284
_logger.throwing(ex, class_name=_class_name, method_name=_method_name)
285285
raise ex
286286
elif len(items) == 1:
287-
#
288-
# In WLST online mode, WLST will go figure out the right name for us so we can just use the existing name.
289-
#
290-
if wlst_mode == WlstModes.ONLINE:
291-
_logger.exiting(class_name=_class_name, method_name=_method_name, result=name)
292-
return name
293-
else:
294-
# Otherwise, no spec version specified so nothing to add to name_tuple
295-
pass
287+
pass
296288
else:
297289
ex = exception_helper.create_deploy_exception('WLSDPLY-09107', name, len(items) - 1)
298290
_logger.throwing(ex, class_name=_class_name, method_name=_method_name)

0 commit comments

Comments
 (0)