Send Linux-ha-cvs mailing list submissions to
        linux-ha-cvs@lists.linux-ha.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: mgmt by zhenh from 
      (linux-ha-cvs@lists.linux-ha.org)
   2. Linux-HA CVS: mgmt by zhenh from 
      (linux-ha-cvs@lists.linux-ha.org)
   3. Linux-HA CVS: include by zhenh from 
      (linux-ha-cvs@lists.linux-ha.org)


----------------------------------------------------------------------

Message: 1
Date: Wed, 10 May 2006 20:45:56 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : zhenh
Host    : 
Project : linux-ha
Module  : mgmt

Dir     : linux-ha/mgmt/client


Modified Files:
        haclient.py.in 


Log Message:
1.add the support of the parameter of group, 2.remove adding empty group, give 
a new group name when adding a new resource will create the group
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.py.in,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- haclient.py.in      9 May 2006 09:56:56 -0000       1.32
+++ haclient.py.in      11 May 2006 02:45:56 -0000      1.33
@@ -1088,9 +1088,7 @@
                                        passed = check_entry_value(glade, 
"clone_node_max")
                                        passed = check_entry_value(glade, 
"master_max")
                                        passed = check_entry_value(glade, 
"master_node_max")
-                               rsc = {}
-                               rsc["id"] = glade.get_widget("id").get_text()
-                               if manager.rsc_exists(rsc["id"]) :
+                               if 
manager.rsc_exists(glade.get_widget("id").get_text()) :
                                        msgbox(_("the ID already exists"))
                                        passed = False
                                
@@ -1123,6 +1121,47 @@
                                        return None
                
        
+class GrpView(View) :
+       name = "grpview"
+       param_list = None
+       params_save = None
+       
+       def on_apply(self, widget):
+               glade = self.glade
+               View.on_apply(self, widget)
+               new_params = self.param_list.get_data()
+               
manager.update_attrs("up_rsc_params\n"+self.param,"del_rsc_param",
+                                  self.params_save, new_params, 
["id","name","value"]);
+               
+       def update(self) :
+               glade = self.glade
+               group_id = self.param
+               params = manager.get_rsc_params(group_id)
+               self.params_save = params
+               glade.get_widget("id").set_text(group_id)
+                                               
+               self.param_list.clear()
+               if params != [] :
+                       for param in params:
+                               self.param_list.insert(param)
+               
+               View.update(self)
+               
+       def __init__(self, grp) :
+               View.__init__(self, grp)
+               glade = self.glade
+                       
+               self.param_list = ListWithAddDel(glade.get_widget("parameters"),
+                                           glade.get_widget("addparam"),
+                                           glade.get_widget("delparam"),
+                                           _("Add Parameter"),
+                                           [Field("id", _("ID"), "", None, 
False, auto_gen=True),
+                                            Field("name", _("Name"), "", None, 
False),
+                                            Field("value", _("Value"), "", 
None, True)],
+                                           self.on_changed)
+                                     
+               self.update()
+
 class MainWindow :
        '''
        Main UI window to show information to user and get user's input
@@ -1170,15 +1209,15 @@
 
                self.set_action_sensitive('startrsc',
                        manager.connected
-                       and self.cur_type in [_("native")])
+                       and self.cur_type in [_("native"),_("group")])
 
                self.set_action_sensitive('stoprsc',
                        manager.connected
-                       and self.cur_type in [_("native")])
+                       and self.cur_type in [_("native"),_("group")])
 
                self.set_action_sensitive('defaultrsc',
                        manager.connected
-                       and self.cur_type in [_("native")])
+                       and self.cur_type in [_("native"),_("group")])
        # functions
        def update(self) :
                self.tree.update()
@@ -1207,6 +1246,8 @@
                        self.cur_view = CloneView(name)
                elif type == _("master") :
                        self.cur_view = MasterView(name)
+               elif type == _("group") :
+                       self.cur_view = GrpView(name)
                else :
                        self.cur_view = View()
                self.view_widget.add(self.cur_view.widget)
@@ -1263,16 +1304,12 @@
        def on_add_item(self, action) :
                new_type = kvbox(_("The type of new item"),
                                [Field("type",_("Item Type"),_("native"),
-                               [_("native"), _("group"), 
_("place"),_("order"), _("colocation")])])
+                               [_("native"), _("place"),_("order"), 
_("colocation")])])
                if new_type == None :
                        return
                if new_type["type"] == _("native"):
                        dlg = AddNativeDlg()
                        dlg.run()
-               elif new_type["type"] == _("group") :
-                       group = kvbox(_("Add Resource 
Group"),[Field("id",_("ID"),"group_")])
-                       if group != None :
-                               manager.add_group(group)
                elif new_type["type"] == _("place") :
                        place = kvbox(_("Add Place Constraint"),
                                [Field("id",_("ID"),"place_",None, False),
@@ -1651,7 +1688,13 @@
                if self.rsc_exists(group["id"]):
                        msgbox (_("the ID already exists"))
                        return
-               self.do_cmd("add_grp\n"+group["id"])
+               cmd = "add_grp\n"+group["id"]
+               for param in group["params"] :
+                       cmd += "\n"+param["id"]
+                       cmd += "\n"+param["name"]
+                       cmd += "\n"+param["value"]
+
+               self.do_cmd(cmd)
                if self.failed_reason != "" :
                        msgbox(self.failed_reason)
                
@@ -1714,6 +1757,11 @@
 
                return (attrs, running_on, params, ops)
 
+       def get_rsc_params(self, rsc) :
+               param_attr_names = ["id", "name", "value"]
+               raw_params = self.query("rsc_params\n%s"%rsc)
+               return self.split_attr_list(raw_params, param_attr_names)
+       
        def get_rsc_meta(self, rsc_class, rsc_type, rsc_provider) :
                lines = self.query("rsc_metadata\n%s\n%s\n%s"%(rsc_class, 
rsc_type, rsc_provider))
                if lines == None :




------------------------------

Message: 2
Date: Wed, 10 May 2006 23:10:21 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : zhenh
Host    : 
Project : linux-ha
Module  : mgmt

Dir     : linux-ha/mgmt/daemon


Modified Files:
        mgmt_crm.c 


Log Message:
using the get_rsc_tag()
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- mgmt_crm.c  11 May 2006 02:43:08 -0000      1.32
+++ mgmt_crm.c  11 May 2006 05:10:21 -0000      1.33
@@ -659,23 +659,7 @@
        data_set = get_data_set();
        GET_RESOURCE()
 
-       switch (rsc->variant) {
-               case pe_native:
-                       snprintf(xml, MAX_STRLEN, "<primitive id=\"%s\"/>", 
rsc->id);
-                       break;
-               case pe_group:
-                       snprintf(xml, MAX_STRLEN, "<group id=\"%s\"/>", 
rsc->id);
-                       break;
-               case pe_clone:
-                       snprintf(xml, MAX_STRLEN, "<clone id=\"%s\"/>", 
rsc->id);
-                       break;
-               case pe_master:
-                       snprintf(xml, MAX_STRLEN, "<master_slave id=\"%s\"/>", 
rsc->id);
-                       break;
-               default:
-                       free_data_set(data_set);
-                       return cl_strdup(MSG_FAIL);
-       }
+       snprintf(xml, MAX_STRLEN, "<%s id=\"%s\"/>",get_rsc_tag(rsc), rsc->id);
        free_data_set(data_set);
 
        cib_object = string2xml(xml);




------------------------------

Message: 3
Date: Thu, 11 May 2006 00:25:43 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
Subject: [Linux-ha-cvs] Linux-HA CVS: include by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : zhenh
Host    : 
Project : linux-ha
Module  : include

Dir     : linux-ha/include/mgmt


Modified Files:
        mgmt_common.h 


Log Message:
move resource up or down in group
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/mgmt/mgmt_common.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- mgmt_common.h       11 May 2006 02:43:08 -0000      1.7
+++ mgmt_common.h       11 May 2006 06:25:43 -0000      1.8
@@ -393,6 +393,18 @@
 
 /*
 description:
+       move a resource in group
+format:
+       MSG_MOVE_RSC resource up|down
+return:
+       MSG_OK
+or
+       MSG_FAIL
+*/
+#define MSG_MOVE_RSC           "move_rsc"
+
+/*
+description:
        return the params of a given resource
 format:
        MSG_RSC_PARAMS resource




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
Linux-ha-cvs@lists.linux-ha.org
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 30, Issue 28
********************************************

Reply via email to