Skip to content

Commit 606894c

Browse files
Merge pull request #228 from oracle/jira-wdt-40-custom-ssl-configuration
JIRA WDT-40 Use fully qualified path for keystore location in NM prop…
2 parents fb3dc99 + 32287bf commit 606894c

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ def _create_named_mbeans(self, type_name, model_nodes, base_location, log_create
165165

166166
Creator._create_named_mbeans(self, type_name, model_nodes, base_location, log_created=log_created)
167167

168+
# Override
169+
def _create_mbean(self, type_name, model_nodes, base_location, log_created=False):
170+
Creator._create_mbean(self, type_name, model_nodes, base_location, log_created)
171+
172+
# check for file paths that need to be qualified
173+
self.topology_helper.qualify_nm_properties(type_name, model_nodes, base_location, self.model_context,
174+
self.attribute_setter)
175+
168176
def __run_rcu(self):
169177
"""
170178
The method that runs RCU to drop and then create the schemas.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def _add_named_elements(self, type_name, model_nodes, location):
5959

6060
Deployer._add_named_elements(self, type_name, model_nodes, location)
6161

62+
# Override
63+
def _add_model_elements(self, type_name, model_nodes, location):
64+
Deployer._add_model_elements(self, type_name, model_nodes, location)
65+
66+
# check for file paths that need to be qualified
67+
self._topology_helper.qualify_nm_properties(type_name, model_nodes, location, self.model_context,
68+
self.attribute_setter)
69+
6270
def update(self):
6371
"""
6472
Deploy resource model elements at the domain level, including multi-tenant elements.

core/src/main/python/wlsdeploy/tool/util/topology_helper.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
"""
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55

66
import wlsdeploy.tool.deploy.deployer_utils as deployer_utils
77
import wlsdeploy.util.dictionary_utils as dictionary_utils
8+
from oracle.weblogic.deploy.util import WLSDeployArchive
89

910
from wlsdeploy.aliases.location_context import LocationContext
1011
from wlsdeploy.aliases.model_constants import CLUSTER
1112
from wlsdeploy.aliases.model_constants import COHERENCE_CLUSTER_SYSTEM_RESOURCE
13+
from wlsdeploy.aliases.model_constants import CUSTOM_IDENTITY_KEYSTORE_FILE
1214
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
15+
from wlsdeploy.aliases.model_constants import NM_PROPERTIES
1316
from wlsdeploy.aliases.model_constants import SERVER
1417
from wlsdeploy.aliases.model_constants import SERVER_TEMPLATE
1518
from wlsdeploy.tool.util.alias_helper import AliasHelper
@@ -113,3 +116,20 @@ def create_placeholder_jdbc_resources(self, resources):
113116
deployer_utils.create_and_cd(resource_location, existing_names, self.alias_helper)
114117

115118
self.wlst_helper.cd(original_location)
119+
120+
def qualify_nm_properties(self, type_name, model_nodes, base_location, model_context, attribute_setter):
121+
"""
122+
For the NM properties MBean, update the keystore file path to be fully qualified with the domain directory.
123+
:param type_name: the type name of the MBean to be checked
124+
:param model_nodes: the model nodes of the MBean to be checked
125+
:param base_location: the parent location of the MBean
126+
:param model_context: the model context of the tool
127+
:param attribute_setter: the attribute setter to be used for update
128+
"""
129+
if type_name == NM_PROPERTIES:
130+
location = LocationContext(base_location).append_location(type_name)
131+
keystore_file = dictionary_utils.get_element(model_nodes, CUSTOM_IDENTITY_KEYSTORE_FILE)
132+
if keystore_file and WLSDeployArchive.isPathIntoArchive(keystore_file):
133+
value = model_context.get_domain_home() + "/" + keystore_file
134+
attribute_setter.set_attribute(location, CUSTOM_IDENTITY_KEYSTORE_FILE, value)
135+

0 commit comments

Comments
 (0)