Skip to content

Commit 682d54d

Browse files
delete of clusters and servers references ServerTemplate in invalid version (#930)
1 parent 4a8f3a5 commit 682d54d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from wlsdeploy.aliases.model_constants import SERVER_TEMPLATE
1616
from wlsdeploy.aliases.model_constants import UNIX_MACHINE
1717
from wlsdeploy.aliases.wlst_modes import WlstModes
18-
from wlsdeploy.exception import exception_helper
1918
from wlsdeploy.exception.expection_types import ExceptionType
2019
from wlsdeploy.tool.create.security_provider_creator import SecurityProviderCreator
2120
from wlsdeploy.tool.deploy import deployer_utils
@@ -101,8 +100,10 @@ def update(self):
101100
self._topology_helper.remove_deleted_clusters_and_servers(location, self._topology)
102101
folder_list.remove(CLUSTER)
103102
folder_list.remove(SERVER)
104-
folder_list.remove(SERVER_TEMPLATE)
105-
folder_list.remove(MIGRATABLE_TARGET)
103+
if SERVER_TEMPLATE in folder_list:
104+
folder_list.remove(SERVER_TEMPLATE)
105+
if MIGRATABLE_TARGET in folder_list:
106+
folder_list.remove(MIGRATABLE_TARGET)
106107

107108
# process remaining top-level folders. copy list to avoid concurrent update in loop
108109
remaining = list(folder_list)

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from wlsdeploy.aliases.model_constants import SERVER
1919
from wlsdeploy.aliases.model_constants import SERVER_TEMPLATE
2020
from wlsdeploy.util import model_helper
21+
from wlsdeploy.util.weblogic_helper import WebLogicHelper
2122
from wlsdeploy.tool.util.wlst_helper import WlstHelper
2223

2324

@@ -31,7 +32,7 @@ def __init__(self, aliases, exception_type, logger):
3132
self.logger = logger
3233
self.aliases = aliases
3334
self.wlst_helper = WlstHelper(exception_type)
34-
35+
self.wl_helper = WebLogicHelper(self.logger)
3536
self._coherence_cluster_elements = [CLUSTER, SERVER, SERVER_TEMPLATE]
3637

3738
def check_coherence_cluster_references(self, type_name, model_nodes):
@@ -184,7 +185,12 @@ def remove_deleted_clusters_and_servers(self, domain_location, model_topology):
184185
_method_name = 'remove_deleted_clusters_and_servers'
185186
self.logger.entering(str(domain_location), class_name=self.__class_name, method_name=_method_name)
186187

187-
for folder_name in [CLUSTER, SERVER_TEMPLATE, SERVER, MIGRATABLE_TARGET]:
188+
folder_names = [CLUSTER, SERVER]
189+
if self.wl_helper.is_weblogic_version_or_above('12.1.2'):
190+
folder_names.append(SERVER_TEMPLATE)
191+
if self.wl_helper.is_weblogic_version_or_above('12.1.3'):
192+
folder_names.append(MIGRATABLE_TARGET)
193+
for folder_name in folder_names:
188194
location = LocationContext(domain_location).append_location(folder_name)
189195
existing_names = deployer_utils.get_existing_object_list(location, self.aliases)
190196
folder_nodes = dictionary_utils.get_dictionary_element(model_topology, folder_name)

0 commit comments

Comments
 (0)