From f4e286ed2e11c4647757968920f1b0fa67a7d3c3 Mon Sep 17 00:00:00 2001 From: Robert Patrick Date: Wed, 15 Feb 2023 12:17:22 -0600 Subject: [PATCH 1/2] fixing online discovery for domains with dynamic clusters --- .../tool/discover/topology_discoverer.py | 81 ++++++++++--------- .../python/wlsdeploy/tool/util/wlst_helper.py | 19 +++++ .../deploy/messages/wlsdeploy_rb.properties | 3 +- 3 files changed, 66 insertions(+), 37 deletions(-) diff --git a/core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py b/core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py index 1e84e1f40..13529d48c 100644 --- a/core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py +++ b/core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py @@ -69,59 +69,68 @@ def discover(self): _logger.info('WLSDPLY-06600', class_name=_class_name, method_name=_method_name) - self.discover_domain_parameters() + current_tree = None + if self._wlst_mode == WlstModes.ONLINE: + current_tree = self._wlst_helper.current_tree() + self._wlst_helper.edit() - model_top_folder_name, clusters = self.get_clusters() - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, clusters) + try: + self.discover_domain_parameters() - model_top_folder_name, servers = self.get_servers() - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, servers) + model_top_folder_name, clusters = self.get_clusters() + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, clusters) - model_top_folder_name, migratable_targets = self.get_migratable_targets() - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, migratable_targets) + model_top_folder_name, servers = self.get_servers() + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, servers) - model_top_folder_name, templates = self.get_server_templates() - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, templates) + model_top_folder_name, migratable_targets = self.get_migratable_targets() + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, migratable_targets) - model_top_folder_name, unix_machines = self.get_unix_machines() - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, unix_machines) + model_top_folder_name, templates = self.get_server_templates() + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, templates) - model_top_folder_name, machines = self.get_machines(unix_machines) - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, machines) + model_top_folder_name, unix_machines = self.get_unix_machines() + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, unix_machines) - # make sure this is after discovery of machines / node managers as we will do some massaging - model_top_folder_name, security_configuration = self.discover_security_configuration() - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, security_configuration) + model_top_folder_name, machines = self.get_machines(unix_machines) + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, machines) - model_top_folder_name, embedded_ldap_configuration = self.get_embedded_ldap_configuration() - discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, embedded_ldap_configuration) + # make sure this is after discovery of machines / node managers as we will do some massaging + model_top_folder_name, security_configuration = self.discover_security_configuration() + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, security_configuration) - model_folder_name, folder_result = self._get_log_filters() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_top_folder_name, embedded_ldap_configuration = self.get_embedded_ldap_configuration() + discoverer.add_to_model_if_not_empty(self._dictionary, model_top_folder_name, embedded_ldap_configuration) - model_folder_name, folder_result = self._get_reliable_delivery_policies() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self._get_log_filters() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) - model_folder_name, folder_result = self._get_virtual_hosts() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self._get_reliable_delivery_policies() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) - model_folder_name, folder_result = self._get_xml_entity_caches() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self._get_virtual_hosts() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) - model_folder_name, folder_result = self._get_xml_registries() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self._get_xml_entity_caches() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) - model_folder_name, folder_result = self.get_managed_executor_template() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self._get_xml_registries() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) - model_folder_name, folder_result = self.get_managed_thread_factory_template() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self.get_managed_executor_template() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) - model_folder_name, folder_result = self.get_managed_scheduled_executor_service() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self.get_managed_thread_factory_template() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) - model_folder_name, folder_result = self._get_ws_securities() - discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + model_folder_name, folder_result = self.get_managed_scheduled_executor_service() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + + model_folder_name, folder_result = self._get_ws_securities() + discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result) + finally: + if current_tree is not None: + current_tree() _logger.exiting(class_name=_class_name, method_name=_method_name) return self._dictionary diff --git a/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py b/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py index fb270f856..29e903ba6 100644 --- a/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py +++ b/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py @@ -1344,6 +1344,25 @@ def have_unsaved_changes(self, cmgr): result=StringUtils.stringForBoolean(unsaved)) return unsaved + def current_tree(self): + """ + Change to the serverConfig MBean tree. + :raises Exception for the specified tool type: if a WLST error occurs + """ + _method_name = 'current_tree' + self.__logger.entering(class_name=self.__class_name, method_name=_method_name) + + current_tree = None; + try: + current_tree = self.__load_global('currentTree')() + except self.__load_global('WLSTException'), e: + pwe = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-00130', + _format_exception(e), error=e) + self.__logger.throwing(class_name=self.__class_name, method_name=_method_name, error=pwe) + raise pwe + self.__logger.exiting(class_name=self.__class_name, method_name=_method_name) + return current_tree + def server_config(self): """ Change to the serverConfig MBean tree. 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 4eb7b72c4..4ee2dc85f 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 @@ -112,6 +112,7 @@ WLSDPLY-00126=Exiting is_set({0}) method WLSDPLY-00127=Unable to load the DomainRuntimeService from the WLST globals : {0} WLSDPLY-00128=setTopologyProfile({0}) failed: {1} WLSDPLY-00129=Error calling isSet() for attribute {0} at location {1}: {2} +WLSDPLY-00130=Failed to get the current MBean tree: {0} ############################################################################### # Util messages (1000 - 3999) # @@ -1772,7 +1773,7 @@ WLSDPLY-20203={0} entries "{1}" and "{2}" in {3} "{4}" have different {5} values # Common messages used for tool exit and clean-up WLSDPLY-21000={0} Messages: WLSDPLY-21001= {0} total : {1} -WLSDPLY-21002= Total: {0} +WLSDPLY-21002=Total: {0} WLSDPLY-21003=Issue Log for {0} version {1} running WebLogic version {2} {3} mode: # RCUDbinfo From e8076c186305b2a71ef42ec051e2027164fc3cc3 Mon Sep 17 00:00:00 2001 From: Robert Patrick Date: Wed, 15 Feb 2023 12:49:17 -0600 Subject: [PATCH 2/2] fixing comment to match new method --- core/src/main/python/wlsdeploy/tool/util/wlst_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py b/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py index 29e903ba6..a4e63e9fd 100644 --- a/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py +++ b/core/src/main/python/wlsdeploy/tool/util/wlst_helper.py @@ -1346,7 +1346,7 @@ def have_unsaved_changes(self, cmgr): def current_tree(self): """ - Change to the serverConfig MBean tree. + Get the current MBean tree. :raises Exception for the specified tool type: if a WLST error occurs """ _method_name = 'current_tree'