Send Linux-ha-cvs mailing list submissions to
[email protected]
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
([email protected])
2. Linux-HA CVS: mgmt by zhenh from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Wed, 10 May 2006 20:43:08 -0600 (MDT)
From: [email protected]
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:
add the support of the parameter of group
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- mgmt_crm.c 9 May 2006 06:00:06 -0000 1.31
+++ mgmt_crm.c 11 May 2006 02:43:08 -0000 1.32
@@ -101,6 +101,7 @@
static const char* uname2id(const char* node);
static resource_t* get_parent(resource_t* child);
static int get_fix(const char* rsc_id, char* prefix, char* suffix);
+static const char* get_rsc_tag(resource_t* rsc);
pe_working_set_t* cib_cached = NULL;
int cib_cache_enable = FALSE;
@@ -253,7 +254,24 @@
free_data_set(data_set);
return NULL;
}
-
+static const char*
+get_rsc_tag(resource_t* rsc)
+{
+ switch (rsc->variant) {
+ case pe_native:
+ return "primitive";
+ case pe_group:
+ return "group";
+ case pe_clone:
+ return "clone";
+ case pe_master:
+ return "master_slave";
+ case pe_unknown:
+ default:
+ return "unknown";
+ }
+
+}
static int
get_fix(const char* rsc_id, char* prefix, char* suffix)
{
@@ -262,17 +280,20 @@
pe_working_set_t* data_set;
char* colon;
char real_id[MAX_STRLEN];
- char parent_type[MAX_STRLEN];
+ char parent_tag[MAX_STRLEN];
+ char rsc_tag[MAX_STRLEN];
data_set = get_data_set();
rsc = pe_find_resource(data_set->resources, rsc_id);
if (rsc == NULL) {
return -1;
}
+ strncpy(rsc_tag, get_rsc_tag(rsc), MAX_STRLEN);
+
parent = get_parent(rsc);
if (parent == NULL) {
- snprintf(prefix, MAX_STRLEN,"<primitive id=\"%s\">", rsc_id);
- snprintf(suffix, MAX_STRLEN,"</primitive>");
+ snprintf(prefix, MAX_STRLEN,"<%s id=\"%s\">",rsc_tag, rsc_id);
+ snprintf(suffix, MAX_STRLEN,"</%s>", rsc_tag);
}
else {
strncpy(real_id, rsc_id, MAX_STRLEN);
@@ -280,25 +301,11 @@
if (colon != NULL) {
*colon = '\0';
}
- switch (parent->variant) {
- case pe_group:
- strncpy(parent_type, "group", MAX_STRLEN);
- break;
- case pe_clone:
- strncpy(parent_type, "clone", MAX_STRLEN);
- break;
- case pe_master:
- strncpy(parent_type, "master_slave",
MAX_STRLEN);
- break;
- case pe_unknown:
- case pe_native:
- free_data_set(data_set);
- return -1;
- }
+ strncpy(parent_tag, get_rsc_tag(parent), MAX_STRLEN);
- snprintf(prefix, MAX_STRLEN,"<%s id=\"%s\"><primitive
id=\"%s\">"
- , parent_type,parent->id,real_id);
- snprintf(suffix, MAX_STRLEN,"</primitive></%s>",parent_type);
+ snprintf(prefix, MAX_STRLEN,"<%s id=\"%s\"><%s id=\"%s\">"
+ , parent_tag, parent->id, rsc_tag, real_id);
+ snprintf(suffix, MAX_STRLEN,"</%s></%s>",rsc_tag, parent_tag);
}
free_data_set(data_set);
return 0;
@@ -881,14 +888,23 @@
char*
on_add_grp(char* argv[], int argc)
{
- int rc;
+ int rc, i;
crm_data_t* fragment = NULL;
crm_data_t* cib_object = NULL;
crm_data_t* output;
char xml[MAX_STRLEN];
+ char buf[MAX_STRLEN];
- ARGC_CHECK(2);
- snprintf(xml, MAX_STRLEN,"<group id=\"%s\"/>", argv[1]);
+ snprintf(xml, MAX_STRLEN,"<group id=\"%s\">", argv[1]);
+ strncat(xml,"<instance_attributes> <attributes>", MAX_STRLEN);
+ for (i = 2; i < argc; i += 3) {
+ snprintf(buf, MAX_STRLEN,
+ "<nvpair id=\"%s\" name=\"%s\" value=\"%s\"/>",
+ argv[i], argv[i+1],argv[i+2]);
+ strncat(xml, buf, MAX_STRLEN);
+ }
+ strncat(xml,"</attributes></instance_attributes> ", MAX_STRLEN);
+ strncat(xml,"</group>",MAX_STRLEN);
cib_object = string2xml(xml);
if(cib_object == NULL) {
return cl_strdup(MSG_FAIL);
------------------------------
Message: 2
Date: Wed, 10 May 2006 20:43:37 -0600 (MDT)
From: [email protected]
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.glade
Log Message:
add the support of the parameter of group
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.glade,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- haclient.glade 3 Mar 2006 09:15:36 -0000 1.6
+++ haclient.glade 11 May 2006 02:43:37 -0000 1.7
@@ -4453,4 +4453,289 @@
</child>
</widget>
+<widget class="GtkWindow" id="group">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes"></property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+
+ <child>
+ <widget class="GtkVBox" id="grpview">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkFrame" id="frame17">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment16">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkTable" id="table12">
+ <property name="visible">True</property>
+ <property name="n_rows">1</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">True</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">10</property>
+
+ <child>
+ <widget class="GtkLabel" id="label185">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">ID:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">10</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="id">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label193">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Attributes:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFrame" id="frame18">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment17">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox17">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow11">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property
name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property
name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="parameters">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">True</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox18">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkButton" id="addparam">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label"
translatable="yes">Add</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="delparam">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label"
translatable="yes">Delete</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label194">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Parameters:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHButtonBox" id="r_action">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkButton" id="apply">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Apply</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="reset">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Reset</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 30, Issue 27
********************************************