Skip to content

Commit 323b94d

Browse files
committed
Merge branch 'jms-foreign-server' into 'main'
fixing JMS foreign server discovery to not use method that does not accept... See merge request weblogic-cloud/weblogic-deploy-tooling!1749
2 parents cb7460f + 9be67ba commit 323b94d

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

core/src/main/python/wlsdeploy/tool/discover/discoverer.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,8 +1096,8 @@ def _get_from_url(self, owner_name, file_name):
10961096
success = True
10971097
url = None
10981098
path = None
1099-
try:
1100-
uri = URI(file_name)
1099+
uri = self._get_uri(owner_name, file_name)
1100+
if uri is not None:
11011101
if 'http' == uri.getScheme() or 'https' == uri.getScheme():
11021102
url = uri.toURL()
11031103
elif 'file' == uri.getScheme() or uri.getScheme() is None:
@@ -1106,10 +1106,8 @@ def _get_from_url(self, owner_name, file_name):
11061106
success = False
11071107
_logger.warning('WLSDPLY-06160', owner_name, file_name, uri.getScheme(),
11081108
class_name=_class_name, method_name=_method_name)
1109-
except (URISyntaxException, MalformedURLException), e:
1109+
else:
11101110
success = False
1111-
_logger.warning('WLSDPLY-06321', owner_name, file_name, e.getLocalizedMessage,
1112-
error=e, class_name=_class_name, method_name=_method_name)
11131111

11141112
_logger.exiting(class_name=_class_name, method_name=_method_name, result=(success, url, path))
11151113
return success, url, path
@@ -1118,6 +1116,16 @@ def download_deployment_from_remote_server(self, source_path, local_download_roo
11181116
return self.path_helper.download_file_from_remote_server(self._model_context, source_path,
11191117
local_download_root, file_type)
11201118

1119+
def _get_uri(self, name, value):
1120+
_method_name = '_get_uri'
1121+
uri = None
1122+
try:
1123+
uri = URI(value)
1124+
except (URISyntaxException, MalformedURLException), e:
1125+
_logger.warning('WLSDPLY-06321', name, value, e.getLocalizedMessage,
1126+
error=e, class_name=_class_name, method_name=_method_name)
1127+
return uri
1128+
11211129

11221130
def add_to_model_if_not_empty(dictionary, entry_name, entry_value):
11231131
"""

core/src/main/python/wlsdeploy/tool/discover/jms_resources_discoverer.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,14 @@ def _add_foreign_server_binding(self, server_name, model_name, model_value):
402402
_logger.entering(server_name, model_name, model_value, class_name=_class_name, method_name=_method_name)
403403
new_name = model_value
404404
if model_value is not None:
405-
# FIXME - This is an ugly hack...
406-
success, _, file_name = self._get_from_url('Foreign Server ' + server_name + ' Connection URL', model_value)
405+
uri = self._get_uri('Foreign Server ' + server_name + ' Connection URL', model_value)
406+
file_name = None
407+
if uri is not None:
408+
if 'file' == uri.getScheme() or uri.getScheme() is None:
409+
file_name = uri.getPath()
410+
407411
archive_file = self._model_context.get_archive_file()
408-
if success and file_name is not None:
412+
if file_name is not None:
409413
if not self._model_context.is_remote():
410414
file_name = self._convert_path(file_name)
411415
_logger.finer('WLSDPLY-06495', server_name, file_name, class_name=_class_name, method_name=_method_name)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ WLSDPLY-06317=Added Coherence Cluster {0} cache configuration file from URL loca
909909
WLSDPLY-06318=Unable to add Coherence Cluster {0} persistence directory {1} type {2} to archive file: {3}
910910
WLSDPLY-06319=Added Coherence Cluster {0} cache configuration file from location {1} to archive file with name {2}
911911
WLSDPLY-06320=Added Coherence Cluster {0} persistence directory {1} type {2} to archive file
912-
WLSDPLY-06321=Unable to access {0} file {1} and will not add the file to the archive: {2}
912+
WLSDPLY-06321=Unable to parse {0} file {1} and will not add the file to the archive: {2}
913913
WLSDPLY-06322=Skipping {0} Coherence Cluster System Resource {1}
914914
WLSDPLY-06323=Skipping discovery of Coherence Cache Config {0} in Coherence Cluster System Resource {1} due to WebLogic Server Bug 35969096
915915
WLSDPLY-06324=Skipping discovery of Coherence Cluster {0} Cache Config {1} due to unexpected problem processing the cache config file location {2}

0 commit comments

Comments
 (0)