Hi all,

I wrote a patch for the exclusion of a problem resource to meta data function. 
(see attached)
This patch revises next problems.

1)When there is the resource that there is a problem in metadata, the resource 
addition dialog is not
displayed.
  With this patch, only a problem resource is excluded, and a dialog is 
displayed.

2)Even if there is a problem in metadata, an operator does not understand it.
  With this patch, a message of the problem resource name is displayed.

Please test out it first, and let me know your comments or questions.
If everybody likes it, and it meets a criterion for
Heartbeat, I hope the next release includes it officially.

Best Regards,
Hideo YAMAUCHI

*** haclient.py.in      2007-10-22 17:17:16.000000000 +0900
--- haclient.py.in.132  2007-10-22 17:17:41.000000000 +0900
***************
*** 1588,1596 ****
                                provider_list = manager.get_rsc_providers(c,t)
                                for p in provider_list :
                                        desc = ""
!                                       meta = manager.get_rsc_meta(c,t,p)
                                        if meta != None :
                                                desc = meta.shortdesc
                                        if c=="heartbeat" :
                                                p = "heartbeat"
                                        elif c=="stonith" :
--- 1588,1599 ----
                                provider_list = manager.get_rsc_providers(c,t)
                                for p in provider_list :
                                        desc = ""
!                                       meta = manager.get_rsc_meta(c,t,p,True)
                                        if meta != None :
                                                desc = meta.shortdesc
+                                       else :
+                                               if c == "ocf" :
+                                                       continue
                                        if c=="heartbeat" :
                                                p = "heartbeat"
                                        elif c=="stonith" :
***************
*** 2689,2695 ****
                return desc_en                          
                
                        
!       def get_rsc_meta(self, rsc_class, rsc_type, rsc_provider) :
                if rsc_class == None or rsc_type == None :
                        return None
                lines = self.query("rsc_metadata\n%s\n%s\n%s"% \
--- 2692,2698 ----
                return desc_en                          
                
                        
!       def get_rsc_meta(self, rsc_class, rsc_type, rsc_provider, dspmsg=False) 
:
                if rsc_class == None or rsc_type == None :
                        return None
                lines = self.query("rsc_metadata\n%s\n%s\n%s"% \
***************
*** 2717,2736 ****
                meta.shortdesc = self.get_locale_desc(doc_xml, "shortdesc");
                
                meta.parameters = []
!               for param_xml in doc_xml.getElementsByTagName("parameter") :
!                       param = {}
!                       param["name"] = param_xml.getAttribute("name")
!                       param["required"] = param_xml.getAttribute("required")
!                       param["unique"] = param_xml.getAttribute("unique")
!                       param["longdesc"] = self.get_locale_desc(param_xml, 
"longdesc");
!                       param["shortdesc"] = self.get_locale_desc(param_xml, 
"shortdesc");
!                       content_xml = 
param_xml.getElementsByTagName("content")[0]
!                       content = {}
!                       content["type"] = content_xml.getAttribute("type")
!                       content["default"] = content_xml.getAttribute("default")
!                       param["value"] = content["default"]
!                       param["content"] = content
!                       meta.parameters.append(param)
                meta.actions = []
                for action_xml in doc_xml.getElementsByTagName("action") :
                        action = {}
--- 2720,2747 ----
                meta.shortdesc = self.get_locale_desc(doc_xml, "shortdesc");
                
                meta.parameters = []
!               param_xml = doc_xml.getElementsByTagName("parameter");
!               if param_xml != [] :
!                       for param_xml in 
doc_xml.getElementsByTagName("parameter") :
!                               param = {}
!                               try : 
!                                       param["name"] = 
param_xml.getAttribute("name")
!                                       param["required"] = 
param_xml.getAttribute("required")
!                                       param["unique"] = 
param_xml.getAttribute("unique")
!                                       param["longdesc"] = 
self.get_locale_desc(param_xml, "longdesc");
!                                       param["shortdesc"] = 
self.get_locale_desc(param_xml, "shortdesc");
!                                       content_xml = 
param_xml.getElementsByTagName("content")[0]
!                                       content = {}
!                                       content["type"] = 
content_xml.getAttribute("type")
!                                       content["default"] = 
content_xml.getAttribute("default")
!                                       param["value"] = content["default"]
!                                       param["content"] = content
!                                       meta.parameters.append(param)
!                               except :
!                                       if dspmsg == True : 
!                                               msgbox(_("problem in metadata 
of ") + meta.name)        
!                                       return None
!               
                meta.actions = []
                for action_xml in doc_xml.getElementsByTagName("action") :
                        action = {}
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to