Skip to content

Commit 9485ad2

Browse files
CarolynRountreeddsharpe
authored andcommitted
warn about not supported kss keystore type (#515)
1 parent 26b684a commit 9485ad2

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

core/src/main/python/wlsdeploy/aliases/model_constants.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"""
2-
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55

66
# lists may be represented in the model as comma-separated strings
77
MODEL_LIST_DELIMITER = ','
8+
KSS_KEYSTORE_TYPE = 'kss'
9+
KSS_KEYSTORE_FILE_INDICATOR = 'kss:'
810

911

1012
# names of model elements, alphabetically

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
from java.io import File
@@ -14,6 +14,7 @@
1414
from wlsdeploy.aliases import model_constants
1515
from wlsdeploy.aliases.location_context import LocationContext
1616
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
17+
from wlsdeploy.aliases.model_constants import KSS_KEYSTORE_FILE_INDICATOR
1718
from wlsdeploy.aliases.wlst_modes import WlstModes
1819
from wlsdeploy.exception import exception_helper
1920
from wlsdeploy.logging.platform_logger import PlatformLogger
@@ -664,13 +665,19 @@ def _add_keystore_file_to_archive(self, model_name, model_value, location):
664665
_logger.entering(model_name, str(location), class_name=_class_name, method_name=_method_name)
665666
new_name = None
666667
if not string_utils.is_empty(model_value):
667-
server_name = self._get_server_name_from_location(location)
668-
archive_file = self._model_context.get_archive_file()
669-
file_path = self._convert_path(model_value)
670-
if server_name:
671-
new_name = self._add_server_keystore_file_to_archive(server_name, archive_file, file_path)
668+
_logger.finer('WLSDPLY-06641', location.get_folder_path(), model_value,
669+
class_name=_class_name, method_name=_method_name)
670+
if _kss_file_type(model_value):
671+
_logger.warning('WLSDPLY-06642', model_value, location.get_folder_path(),
672+
class_name=_class_name, method_name=_method_name)
672673
else:
673-
new_name = self._add_node_manager_keystore_file_to_archive(archive_file, file_path)
674+
server_name = self._get_server_name_from_location(location)
675+
archive_file = self._model_context.get_archive_file()
676+
file_path = self._convert_path(model_value)
677+
if server_name:
678+
new_name = self._add_server_keystore_file_to_archive(server_name, archive_file, file_path)
679+
else:
680+
new_name = self._add_node_manager_keystore_file_to_archive(archive_file, file_path)
674681

675682
_logger.exiting(class_name=_class_name, method_name=_method_name, result=new_name)
676683
return new_name
@@ -732,3 +739,9 @@ def _get_server_name_from_location(self, location):
732739
temp = LocationContext()
733740
temp.append_location(model_constants.SERVER)
734741
return location.get_name_for_token(self._alias_helper.get_name_token(temp))
742+
743+
744+
def _kss_file_type(file_name):
745+
if file_name.startswith(KSS_KEYSTORE_FILE_INDICATOR):
746+
return True
747+
return False

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,11 @@ WLSDPLY-06637=Unable to locate and add node manager keystore file {0} to the arc
696696
WLSDPLY-06638=Unexpected exception attempting to add node manager keystore file {0} to the archive : {1}
697697
WLSDPLY-06639=Skipping Embedded LDAP Server Configuration
698698
WLSDPLY-06640=Adding Embedded LDAP Server Configuration
699+
WLSDPLY-06641=Custom Keystore file name at location {0} is {1}
700+
WLSDPLY-06642=Custom Keystore file {0} at location {1} is a kss type which is not currently supported. \
701+
The Custom Keystore file will not be added to the archive file. Use export / import to \
702+
add the file to the target domain
703+
699704

700705
# multi_tenant_discoverer.py, multi_tenant_resources_dsi
701706
WLSDPLY-06700=Discover Multi-tenant

0 commit comments

Comments
 (0)