Skip to content

Commit 5b00a44

Browse files
Check for server template under dynamic server before setting server groups to dynamic cluster (#807)
1 parent 70cdb87 commit 5b00a44

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
2121
from wlsdeploy.aliases.model_constants import SERVER
2222
from wlsdeploy.aliases.model_constants import SERVER_GROUP_TARGETING_LIMITS
23+
from wlsdeploy.aliases.model_constants import SERVER_TEMPLATE
2324
from wlsdeploy.exception import exception_helper
2425
from wlsdeploy.tool.util.wlst_helper import WlstHelper
2526
from wlsdeploy.util import string_utils
@@ -364,9 +365,16 @@ def _get_clusters_and_members_map(self):
364365
cluster_location.append_location(DYNAMIC_SERVERS)
365366
wlst_subfolder_name = self.aliases.get_wlst_mbean_type(cluster_location)
366367
if self.wlst_helper.subfolder_exists(wlst_subfolder_name):
367-
if cluster_name not in cluster_map:
368-
cluster_map[cluster_name] = list()
369-
cluster_map[cluster_name].append(DYNAMIC_SERVERS)
368+
ds_list_path = self.aliases.get_wlst_list_path(cluster_location)
369+
ds_names = self.wlst_helper.get_existing_object_list(ds_list_path)
370+
if len(ds_names) > 0:
371+
cluster_location.add_name_token(self.aliases.get_name_token(cluster_location), ds_names[0])
372+
cluster_attributes_path = self.aliases.get_wlst_attributes_path(cluster_location)
373+
self.wlst_helper.cd(cluster_attributes_path)
374+
if self.wlst_helper.get(SERVER_TEMPLATE) is not None:
375+
if cluster_name not in cluster_map:
376+
cluster_map[cluster_name] = list()
377+
cluster_map[cluster_name].append(DYNAMIC_SERVERS)
370378

371379
self.logger.exiting(class_name=self.__class_name, method_name=_method_name, result=cluster_map)
372380
return cluster_map
@@ -529,7 +537,7 @@ def get_dc_to_server_groups_map(self, dynamic_cluster_names, server_groups, dc_s
529537
_method_name = 'get_dc_to_server_groups_list'
530538

531539
self.logger.entering(str(dynamic_cluster_names), str(server_groups), str(dc_sg_targeting_limits),
532-
class_name=self.__class_name, method_name=_method_name)
540+
class_name=self.__class_name, method_name=_method_name)
533541
result = OrderedDict()
534542
revised_server_groups = self._revised_list_server_groups(server_groups, dc_sg_targeting_limits)
535543
for cluster_name in dynamic_cluster_names:

0 commit comments

Comments
 (0)