diff --git a/core/src/main/python/update.py b/core/src/main/python/update.py index 508bdd552..349b4e441 100644 --- a/core/src/main/python/update.py +++ b/core/src/main/python/update.py @@ -240,6 +240,8 @@ def __update_online(model, model_context, aliases): exit_code = 0 __update_online_domain(model_context) + __wlst_helper.edit() + __wlst_helper.start_edit() topology_updater.set_server_groups() __update_online_domain(model_context) diff --git a/core/src/main/python/wlsdeploy/tool/create/domain_creator.py b/core/src/main/python/wlsdeploy/tool/create/domain_creator.py index f064b54cf..c32850c42 100644 --- a/core/src/main/python/wlsdeploy/tool/create/domain_creator.py +++ b/core/src/main/python/wlsdeploy/tool/create/domain_creator.py @@ -758,7 +758,7 @@ def __create_clusters_and_servers(self, location): # create placeholders for JDBC resources that may be referenced in cluster definition. resources_dict = self.model.get_model_resources() - self.topology_helper.create_placeholder_jdbc_resources(resources_dict) + jdbc_names = self.topology_helper.create_placeholder_jdbc_resources(resources_dict) cluster_nodes = dictionary_utils.get_dictionary_element(self._topology, CLUSTER) if len(cluster_nodes) > 0: self._create_named_mbeans(CLUSTER, cluster_nodes, location, log_created=True) @@ -779,6 +779,9 @@ def __create_clusters_and_servers(self, location): if len(server_nodes) > 0: self._create_named_mbeans(SERVER, server_nodes, location, log_created=True) + # targets may have been inadvertently assigned when clusters were added + self.topology_helper.clear_jdbc_placeholder_targeting(jdbc_names) + self.logger.exiting(class_name=self.__class_name, method_name=_method_name) return diff --git a/core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py b/core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py index 1fa639455..c7bb1c80e 100644 --- a/core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py +++ b/core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py @@ -102,7 +102,7 @@ def update(self): self._topology_helper.create_placeholder_server_templates(self._topology) # create placeholders for JDBC resources that may be referenced in cluster definition. - self._topology_helper.create_placeholder_jdbc_resources(self._resources) + jdbc_names = self._topology_helper.create_placeholder_jdbc_resources(self._resources) self._process_section(self._topology, folder_list, CLUSTER, location) self._process_section(self._topology, folder_list, SERVER_TEMPLATE, location) @@ -113,6 +113,9 @@ def update(self): self._process_section(self._topology, folder_list, SERVER, location) + # targets may have been inadvertently assigned when clusters were added + self.topology_helper.clear_jdbc_placeholder_targeting(jdbc_names) + self._process_section(self._topology, folder_list, MIGRATABLE_TARGET, location) new_managed_server_list, new_configured_cluster_list = self._create_list_of_setservergroups_targets() diff --git a/core/src/main/python/wlsdeploy/tool/util/topology_helper.py b/core/src/main/python/wlsdeploy/tool/util/topology_helper.py index 3b9fd0e3e..c8d29f030 100644 --- a/core/src/main/python/wlsdeploy/tool/util/topology_helper.py +++ b/core/src/main/python/wlsdeploy/tool/util/topology_helper.py @@ -93,8 +93,9 @@ def create_placeholder_jdbc_resources(self, resources): Create a placeholder JDBC resource for each name in the resources section. This is necessary because cluster attributes may reference JDBC resources. :param resources: the resource model nodes + :return: a list of names of created placeholders """ - self.create_placeholder_named_elements(LocationContext(), JDBC_SYSTEM_RESOURCE, resources) + return self.create_placeholder_named_elements(LocationContext(), JDBC_SYSTEM_RESOURCE, resources) def create_placeholder_named_elements(self, location, model_type, model_nodes): """ @@ -103,8 +104,10 @@ def create_placeholder_named_elements(self, location, model_type, model_nodes): :param location: the location for the nodes to be added :param model_type: the type of the specified model nodes :param model_nodes: the model nodes + :return: a list of names of created placeholders """ _method_name = 'create_placeholder_named_elements' + holder_names = [] original_location = self.wlst_helper.get_pwd() resource_location = LocationContext(location).append_location(model_type) @@ -125,8 +128,10 @@ def create_placeholder_named_elements(self, location, model_type, model_nodes): resource_location.add_name_token(token, name) deployer_utils.create_and_cd(resource_location, existing_names, self.alias_helper) self._update_placeholder(model_type, name, resource_location) + holder_names.append(name) self.wlst_helper.cd(original_location) + return holder_names def _update_placeholder(self, type_name, name, location): """ @@ -148,6 +153,26 @@ def _update_placeholder(self, type_name, name, location): self.wlst_helper.set('Name', name) self.wlst_helper.cd(original_location) + def clear_jdbc_placeholder_targeting(self, jdbc_names): + """ + Remove any targets for the JDBC resources in the specified list of names. + Targets may have been inadvertently assigned when clusters were added after JDBC placeholders. + :param jdbc_names: names of placeholders to clear + """ + _method_name = 'clear_jdbc_placeholder_targeting' + resource_location = LocationContext().append_location(JDBC_SYSTEM_RESOURCE) + token = self.alias_helper.get_name_token(resource_location) + + for name in jdbc_names: + self.logger.info('WLSDPLY-19404', JDBC_SYSTEM_RESOURCE, name, class_name=self.__class_name, + method_name=_method_name) + + resource_location.add_name_token(token, name) + wlst_path = self.alias_helper.get_wlst_attributes_path(resource_location) + if self.wlst_helper.path_exists(wlst_path): + mbean = self.wlst_helper.get_mbean_for_wlst_path(wlst_path) + mbean.setTargets(None) + def qualify_nm_properties(self, type_name, model_nodes, base_location, model_context, attribute_setter): """ For the NM properties MBean, update the keystore file path to be fully qualified with the domain directory. diff --git a/core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Server.json b/core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Server.json index 8c9fbb8aa..c1f5bc95f 100644 --- a/core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Server.json +++ b/core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Server.json @@ -250,7 +250,7 @@ "LogFileSeverity": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LogFileSeverity", "wlst_path": "WP001", "value": {"default": "Trace" }, "wlst_type": "string" } ], "LogMonitoringEnabled": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LogMonitoringEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean"} ], "LogMonitoringIntervalSecs": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LogMonitoringIntervalSecs", "wlst_path": "WP001", "value": {"default": 30 }, "wlst_type": "integer"} ], - "LogMonitoringMaxThrottleMessageSignatureCount": [ {"version": "[12.2.1.1,)", "wlst_mode": "online", "wlst_name": "LogMonitoringMaxThrottleMessageSignatureCount", "wlst_path": "WP001", "value": {"default": 1000 }, "wlst_type": "integer"} , + "LogMonitoringMaxThrottleMessageSignatureCount": [ {"version": "[12.2.1.1,12.2.1.3)", "wlst_mode": "online", "wlst_name": "LogMonitoringMaxThrottleMessageSignatureCount", "wlst_path": "WP001", "value": {"default": 1000 }, "wlst_type": "integer"} , {"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "LogMonitoringMaxThrottleMessageSignatureCount", "wlst_path": "WP001", "value": {"default": 1000 }, "wlst_type": "integer"} ], "LogMonitoringThrottleMessageLength": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LogMonitoringThrottleMessageLength", "wlst_path": "WP001", "value": {"default": 50 }, "wlst_type": "integer"} ], "LogMonitoringThrottleThreshold": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LogMonitoringThrottleThreshold", "wlst_path": "WP001", "value": {"default": 1500 }, "wlst_type": "integer"} ], diff --git a/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties b/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties index c5def216b..3335edd7b 100644 --- a/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties +++ b/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties @@ -1345,6 +1345,7 @@ WLSDPLY-19400=Creating placeholder for server template {0} WLSDPLY-19401=Creating placeholder for JDBC resource {0} WLSDPLY-19402=Creating placeholder for Server resource {0} WLSDPLY-19403=Creating placeholder for {0} {1} +WLSDPLY-19404=Clearing targets for {0} placeholder {1} # wlsdeploy/tool/util/variable_injector.py WLSDPLY-19500=Model variable injector values loaded from location {0}