|
1 | 1 | """
|
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. |
3 | 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
|
4 | 4 | """
|
5 | 5 | from java.io import File
|
|
14 | 14 | from wlsdeploy.aliases import model_constants
|
15 | 15 | from wlsdeploy.aliases.location_context import LocationContext
|
16 | 16 | from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
|
| 17 | +from wlsdeploy.aliases.model_constants import KSS_KEYSTORE_FILE_INDICATOR |
17 | 18 | from wlsdeploy.aliases.wlst_modes import WlstModes
|
18 | 19 | from wlsdeploy.exception import exception_helper
|
19 | 20 | from wlsdeploy.logging.platform_logger import PlatformLogger
|
@@ -664,13 +665,19 @@ def _add_keystore_file_to_archive(self, model_name, model_value, location):
|
664 | 665 | _logger.entering(model_name, str(location), class_name=_class_name, method_name=_method_name)
|
665 | 666 | new_name = None
|
666 | 667 | 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) |
672 | 673 | 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) |
674 | 681 |
|
675 | 682 | _logger.exiting(class_name=_class_name, method_name=_method_name, result=new_name)
|
676 | 683 | return new_name
|
@@ -732,3 +739,9 @@ def _get_server_name_from_location(self, location):
|
732 | 739 | temp = LocationContext()
|
733 | 740 | temp.append_location(model_constants.SERVER)
|
734 | 741 | 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 |
0 commit comments