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])
3. Linux-HA CVS: mgmt by zhenh from
([email protected])
4. Linux-HA CVS: include by zhenh from
([email protected])
5. Linux-HA CVS: mgmt by zhenh from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 8 Dec 2005 23:58:42 -0700 (MST)
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_lib.c
Log Message:
set the memory function of mgmt lib to cl_xxx
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_lib.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- mgmt_lib.c 8 Dec 2005 09:21:55 -0000 1.2
+++ mgmt_lib.c 9 Dec 2005 06:58:41 -0000 1.3
@@ -67,6 +67,8 @@
event_map = g_hash_table_new_full(g_str_hash, g_str_equal, cl_free,
NULL);
client_name = client?client:"unknown";
components = enable_components;
+ mgmt_set_mem_funcs(cl_malloc, cl_realloc, cl_free);
+
/* init modules */
if (components & ENABLE_HB) {
init_heartbeat();
------------------------------
Message: 2
Date: Fri, 9 Dec 2005 00:02:24 -0700 (MST)
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:
mgmtd.c
Log Message:
fix a mistype and add more explain of test mode
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmtd.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- mgmtd.c 8 Dec 2005 09:21:55 -0000 1.8
+++ mgmtd.c 9 Dec 2005 07:02:24 -0000 1.9
@@ -221,7 +221,7 @@
static const char usagemsg[] = "[-srkhvt]\n\ts: status\n\tr: restart"
"\n\tk: kill\n\t"
- "h: help\n\tv: debug\n\tv: testmode\n";
+ "h: help\n\tv: debug\n\tt: testmode(e.g. no authority
checking)\n";
void
usage(const char* cmd, int exit_status)
------------------------------
Message: 3
Date: Fri, 9 Dec 2005 00:26:04 -0700 (MST)
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.py.in
Log Message:
save the last login information
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.py.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- haclient.py.in 6 Dec 2005 15:23:55 -0000 1.2
+++ haclient.py.in 9 Dec 2005 07:26:03 -0000 1.3
@@ -24,7 +24,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-import sys,os,string,socket,syslog,webbrowser
+import sys,os,string,socket,syslog,webbrowser, pickle
from xml.dom.minidom import parseString
sys.path.append("@libdir@/heartbeat")
from pymgmt import *
@@ -1132,15 +1132,17 @@
glade = gtk.glade.XML(UI_FILE, "logindlg_main")
main = glade.get_widget("logindlg_main")
dialog.vbox.add(main)
-
- glade.get_widget("server").set_text("127.0.0.1")
- glade.get_widget("username").set_text("hacluster")
- glade.get_widget("password").set_text("hacluster")
+ (server,user) = manager.last_login_info()
+ glade.get_widget("server").set_text(server)
+ glade.get_widget("username").set_text(user)
+ glade.get_widget("password").set_text("")
ret = dialog.run()
server = glade.get_widget("server").get_text()
user = glade.get_widget("username").get_text()
password = glade.get_widget("password").get_text()
+ manager.save_login_info(server,user)
+
dialog.destroy()
if ret :
@@ -1325,7 +1327,18 @@
if self.connected :
mgmt_disconnect()
- # connection functions
+ # connection functions
+ def last_login_info(self) :
+ save_path = os.environ["HOME"]+"/.haclient"
+ if not os.path.exists(save_path) :
+ return ("127.0.0.1","hacluster")
+ return pickle.load(file(save_path,"r"))
+
+ def save_login_info(self, server, user) :
+ save_path = os.environ["HOME"]+"/.haclient"
+ pickle.dump((server,user), file(save_path,"w"))
+ return
+
def login(self, server, username, password) :
# connect to one of the cluster
ip = socket.gethostbyname(server)
------------------------------
Message: 4
Date: Fri, 9 Dec 2005 02:42:23 -0700 (MST)
From: [email protected]
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:
fix wrong comment of MSG_GET_CONSTRAINT
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/mgmt/mgmt_common.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- mgmt_common.h 6 Dec 2005 14:38:29 -0000 1.1
+++ mgmt_common.h 9 Dec 2005 09:42:22 -0000 1.2
@@ -492,7 +492,7 @@
description:
get the parameters of a given constraint
format:
- MSG_GET_CONSTRAINT id
+ MSG_GET_CONSTRAINT (rsc_location|rsc_colocation|rsc_order) id
return:
rsc_location:
MSG_OK id resource score expr_id1 attribute1 operation1 value1
------------------------------
Message: 5
Date: Fri, 9 Dec 2005 02:44:52 -0700 (MST)
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 haclient.py.in
Log Message:
modify several places based on Jiang Dong and James' suggestions
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.glade,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- haclient.glade 6 Dec 2005 15:21:37 -0000 1.2
+++ haclient.glade 9 Dec 2005 09:44:52 -0000 1.3
@@ -914,16 +914,16 @@
<property name="width_request">168</property>
<property name="height_request">214</property>
<property name="visible">True</property>
- <property name="n_rows">9</property>
+ <property name="n_rows">8</property>
<property name="n_columns">2</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
<property name="row_spacing">10</property>
<property name="column_spacing">10</property>
<child>
- <widget class="GtkLabel" id="label56">
+ <widget class="GtkLabel" id="standby">
<property name="visible">True</property>
- <property name="label" translatable="yes"></property>
+ <property name="label" translatable="yes">standby</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -941,46 +941,16 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label55">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_padding">10</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="uname">
+ <widget class="GtkLabel" id="expected_up">
<property name="visible">True</property>
- <property name="label" translatable="yes">uname</property>
+ <property name="label" translatable="yes">expected_up</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -998,18 +968,16 @@
<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="top_attach">5</property>
+ <property name="bottom_attach">6</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="online">
+ <widget class="GtkLabel" id="shutdown">
<property name="visible">True</property>
- <property name="label" translatable="yes">online</property>
+ <property name="label" translatable="yes">shutdown</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1027,18 +995,16 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="is_dc">
+ <widget class="GtkLabel" id="unclean">
<property name="visible">True</property>
- <property name="label" translatable="yes">is_dc</property>
+ <property name="label" translatable="yes">unclean</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1056,11 +1022,9 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
</packing>
</child>
@@ -1088,44 +1052,13 @@
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="standby">
- <property name="visible">True</property>
- <property name="label" translatable="yes">standby</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="expected_up">
+ <widget class="GtkLabel" id="is_dc">
<property name="visible">True</property>
- <property name="label" translatable="yes">expected_up</property>
+ <property name="label" translatable="yes">is_dc</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1143,18 +1076,16 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="shutdown">
+ <widget class="GtkLabel" id="online">
<property name="visible">True</property>
- <property name="label" translatable="yes">shutdown</property>
+ <property name="label" translatable="yes">online</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1172,18 +1103,16 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="unclean">
+ <widget class="GtkLabel" id="uname">
<property name="visible">True</property>
- <property name="label" translatable="yes">unclean</property>
+ <property name="label" translatable="yes">uname</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1201,11 +1130,9 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
</packing>
</child>
@@ -1241,8 +1168,6 @@
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
@@ -1278,8 +1203,6 @@
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
@@ -1315,8 +1238,6 @@
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
@@ -1352,8 +1273,6 @@
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
@@ -1389,8 +1308,6 @@
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
@@ -1426,8 +1343,6 @@
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
@@ -1463,8 +1378,6 @@
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
@@ -1500,8 +1413,6 @@
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
</packing>
</child>
</widget>
@@ -2235,245 +2146,329 @@
<property name="spacing">0</property>
<child>
- <widget class="GtkTable" id="table4">
+ <widget class="GtkHBox" id="hbox4">
<property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
<property name="homogeneous">False</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">0</property>
+ <property name="spacing">0</property>
<child>
- <widget class="GtkLabel" id="label72">
+ <widget class="GtkTable" id="table4">
<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">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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"></property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <property name="n_rows">5</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">0</property>
- <child>
- <widget class="GtkLabel" id="label73">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Class:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <child>
+ <widget class="GtkLabel" id="label72">
+ <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">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">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"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
- <child>
- <widget class="GtkLabel" id="label74">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Type:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <child>
+ <widget class="GtkLabel" id="label73">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Class:</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>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
- <child>
- <widget class="GtkLabel" id="label75">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> Provider:
</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <child>
+ <widget class="GtkLabel" id="label74">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Type:</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>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
- <child>
- <widget class="GtkLabel" id="label77">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Group:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <child>
+ <widget class="GtkLabel" id="label75">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> Provider:
</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>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
- <child>
- <widget class="GtkEntry" id="id">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes">resource_</property>
- <property name="has_frame">True</property>
- <property name="invisible_char">*</property>
- <property name="activates_default">False</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_padding">10</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <child>
+ <widget class="GtkLabel" id="label77">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Group:</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>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
- <child>
- <widget class="GtkComboBoxEntry" id="class">
- <property name="visible">True</property>
- <property name="add_tearoffs">False</property>
- <property name="has_frame">True</property>
- <property name="focus_on_click">True</property>
+ <child>
+ <widget class="GtkEntry" id="id">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes">resource_</property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
+ <property name="activates_default">False</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_padding">10</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBoxEntry" id="class">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="has_frame">True</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_padding">10</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBoxEntry" id="type">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="has_frame">True</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_padding">10</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBoxEntry" id="provider">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="has_frame">True</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_padding">10</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBoxEntry" id="group">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="has_frame">True</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_padding">10</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
</packing>
</child>
<child>
- <widget class="GtkComboBoxEntry" id="type">
+ <widget class="GtkFrame" id="frame15">
<property name="visible">True</property>
- <property name="add_tearoffs">False</property>
- <property name="has_frame">True</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <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="GtkComboBoxEntry" id="provider">
- <property name="visible">True</property>
- <property name="add_tearoffs">False</property>
- <property name="has_frame">True</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment14">
+ <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="GtkComboBoxEntry" id="group">
- <property name="visible">True</property>
- <property name="add_tearoffs">False</property>
- <property name="has_frame">True</property>
- <property name="focus_on_click">True</property>
+ <child>
+ <widget class="GtkLabel" id="label176">
+ <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.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label175">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Description of the
type of resource</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>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
</packing>
</child>
</widget>
@@ -2493,6 +2488,7 @@
<child>
<widget class="GtkAlignment" id="alignment6">
+ <property name="height_request">200</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.py.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- haclient.py.in 9 Dec 2005 07:26:03 -0000 1.3
+++ haclient.py.in 9 Dec 2005 09:44:52 -0000 1.4
@@ -24,8 +24,9 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-import sys,os,string,socket,syslog,webbrowser, pickle
+import sys, os, string, socket, syslog, webbrowser, pickle, xml
from xml.dom.minidom import parseString
+
sys.path.append("@libdir@/heartbeat")
from pymgmt import *
@@ -73,7 +74,8 @@
return False
return True
-def add_column(widget, label, value, icon_cell_func = None, editable = False,
options=None, call_back=None) :
+def add_column(widget, label, value, icon_cell_func = None, editable = False
+ , options=None, call_back=None, visible = True) :
tvcolumn = gtk.TreeViewColumn(label)
widget.append_column(tvcolumn)
if options == None :
@@ -96,7 +98,8 @@
tvcolumn.set_resizable(True)
tvcolumn.pack_start(cell, True)
tvcolumn.add_attribute(cell, 'text', value)
-
+ tvcolumn.set_visible(visible)
+
def msgbox(msg, parent = None) :
if parent == None :
parent = window.win_widget
@@ -135,14 +138,15 @@
table = gtk.Table(2, 1, False)
widgets = []
for row in range(len(fields)):
+ if fields[row].auto_gen :
+ widgets.append(None)
+ continue
table.attach(gtk.Label(fields[row].label+":"), 0, 1, row, row+1)
if fields[row].options != None:
combo = gtk.combo_box_entry_new_text()
for option in fields[row].options:
combo.append_text(option)
- if fields[row].auto_gen :
- combo.child.set_text(uuid())
- elif fields[row].default != None :
+ if fields[row].default != None :
combo.child.set_text(fields[row].default)
else :
combo.child.set_text(fields[row].options[0])
@@ -150,9 +154,7 @@
table.attach(combo, 1,2, row, row+1)
else :
entry = gtk.Entry()
- if fields[row].auto_gen :
- entry.set_text(uuid())
- elif fields[row].default != None :
+ if fields[row].default != None :
entry.set_text(fields[row].default)
widgets.append(entry)
table.attach(entry, 1,2, row, row+1)
@@ -161,13 +163,16 @@
dialog.vbox.show_all()
while True :
ret = dialog.run()
- if ret == gtk.RESPONSE_CANCEL :
+ if ret in [gtk.RESPONSE_CANCEL,gtk.RESPONSE_DELETE_EVENT] :
dialog.destroy()
return None
else :
kv = {}
passed = True
for row in range(len(fields)):
+ if fields[row].auto_gen :
+ kv[fields[row].key] = uuid()
+ continue
if fields[row].options != None :
combo = widgets[row]
kv[fields[row].key] =
combo.child.get_text()
@@ -213,7 +218,8 @@
call_back = None
store = None
fields = None
-
+ add_btn_handler = None
+ del_btn_handler = None
def on_del(self, widget) :
selection = self.widget.get_selection()
(model, iter) = selection.get_selected()
@@ -242,18 +248,26 @@
self.call_back = call_back
self.title = title
self.fields = fields
- add_btn.connect("clicked", self.on_add)
- del_btn.connect("clicked", self.on_del)
+ self.add_btn_handler = add_btn.connect("clicked", self.on_add)
+ self.del_btn_handler = del_btn.connect("clicked", self.on_del)
self.store = self.create_store(len(fields))
widget.set_model(self.store)
for i in range(len(fields)) :
- add_column(widget, fields[i].label, i, None,
fields[i].editable,fields[i].options,call_back)
+ add_column(widget, fields[i].label, i, None,
fields[i].editable,
+ fields[i].options, call_back, not
fields[i].auto_gen)
def clear(self) :
self.store.clear()
+ def destory(self) :
+ self.clear()
+ for c in self.widget.get_columns() :
+ self.widget.remove_column(c)
+ self.add_btn.disconnect(self.add_btn_handler)
+ self.del_btn.disconnect(self.del_btn_handler)
+
def insert(self, item) :
values = []
for f in self.fields :
@@ -285,7 +299,7 @@
widget.set_model(self.store)
add_column(widget, "Name", 0, self.render_icon)
add_column(widget, "Status", 1)
- widget.set_size_request(250, 100)
+ widget.set_size_request(300, 100)
widget.connect("cursor-changed", self.on_cursor_changed,
widget.get_selection())
self.widget = widget
@@ -360,10 +374,11 @@
def restore_iter_status(self, model, path, iter, user_data):
- (select_name, select_type, expand_status) = user_data
+ (select_name, select_type, select_path, expand_status) =
user_data
name = model.get_value(iter, 0)
type = model.get_value(iter, 2)
- if name == select_name and type == select_type :
+ path = model.get_path(iter)
+ if name == select_name and type == select_type and path ==
select_path:
self.widget.get_selection().select_iter(iter)
if expand_status.has_key((name,type)) :
if expand_status[name, type] :
@@ -376,14 +391,16 @@
def save_tree_status(self) :
(model, iter) = self.widget.get_selection().get_selected()
if iter != None :
- selected_name = model.get_value(iter, 0)
- selected_type = model.get_value(iter, 2)
+ select_name = model.get_value(iter, 0)
+ select_type = model.get_value(iter, 2)
+ select_path = model.get_path(iter)
else :
- selected_name = None
- selected_type = None
+ select_name = None
+ select_type = None
+ select_path = None
expand_status = {}
self.store.foreach(self.save_iter_status, expand_status)
- return (selected_name, selected_type, expand_status)
+ return (select_name, select_type, select_path, expand_status)
def restore_tree_status(self, tree_status) :
self.store.foreach(self.restore_iter_status, tree_status)
@@ -443,7 +460,7 @@
self.store.append(colocations_root,[colocation["id"],
"", "colocation"])
self.restore_tree_status(tree_status)
- (name, type, expand_status) = tree_status
+ (name, type, path, expand_status) = tree_status
if name == None :
self.widget.get_selection().select_iter(root)
self.widget.expand_all()
@@ -877,19 +894,35 @@
param_list = None
glade = None
def update_param_list(self) :
- if self.param_list == None :
- return
- self.param_list.clear()
+ if self.param_list :
+ self.param_list.destory()
cur_class = self.glade.get_widget("class").child.get_text()
cur_type = self.glade.get_widget("type").child.get_text()
cur_provider =
self.glade.get_widget("provider").child.get_text()
meta = manager.get_rsc_meta(cur_class, cur_type, cur_provider)
- if meta == None :
- return
- for param in meta.parameters :
- param["id"] = uuid()
- self.param_list.insert(param)
-
+ param_names = None
+ param_descs = None
+ if meta != None :
+ param_names = [f["name"] for f in meta.parameters]
+ param_descs = [f["shortdesc"] for f in meta.parameters]
+
+ fields = [Field("id", "ID", "id_", None, False, auto_gen =
True),
+ Field("name", "Name", "", param_names, False),
+ Field("value", "Value", "", None, True),
+ Field("shortdesc", "Description", "", param_descs,
False,False)]
+ glade = self.glade
+ param_list = ListWithAddDel(glade.get_widget("parameters"),
+ glade.get_widget("addparam"),
+ glade.get_widget("delparam"),
+ "", fields)
+
+ self.param_list = param_list
+ if meta != None :
+ for param in meta.parameters :
+ param["id"] = uuid()
+ self.param_list.insert(param)
+
+
def on_provider_changed(self, widget, glade) :
self.update_param_list()
@@ -996,21 +1029,21 @@
glade.get_widget("group").set_model(store)
glade.get_widget("group").set_text_column(0)
- fields = [Field("id", "ID", "id_", None, False, auto_gen =
True),
- Field("name", "Name", "", None, False),
- Field("value", "Value", "", None, True),
- Field("shortdesc", "Description", "", None,
False,False)]
-
- param_list = ListWithAddDel(glade.get_widget("parameters"),
- glade.get_widget("addparam"),
- glade.get_widget("delparam"),
- "", fields)
-
- self.param_list = param_list
+# fields = [Field("id", "ID", "id_", None, False, auto_gen =
True),
+# Field("name", "Name", "", None, False),
+# Field("value", "Value", "", None, True),
+# Field("shortdesc", "Description", "", None,
False,False)]
+#
+# param_list = ListWithAddDel(glade.get_widget("parameters"),
+# glade.get_widget("addparam"),
+# glade.get_widget("delparam"),
+# "", fields)
+#
+# self.param_list = param_list
self.update_param_list()
while True :
ret = dialog.run()
- if ret == gtk.RESPONSE_CANCEL :
+ if ret in [gtk.RESPONSE_CANCEL,
gtk.RESPONSE_DELETE_EVENT] :
dialog.destroy()
return None
else :
@@ -1212,7 +1245,7 @@
win_widget = gtk.Window()
win_widget.connect("delete_event", self.on_delete_event)
win_widget.set_title("Linux HA Management Client")
- win_widget.set_size_request(650, 600)
+ win_widget.set_size_request(750, 600)
win_widget.set_icon_from_file("@libdir@/heartbeat/ha.png")
# create ui-manager
@@ -1505,8 +1538,11 @@
meta_data = ""
for line in lines :
meta_data = meta_data +line
- doc_xml = parseString(meta_data).documentElement
-
+ try :
+ doc_xml = parseString(meta_data).documentElement
+ except xml.parsers.expat.ExpatError:
+ return None
+
meta = RAMeta()
meta.name = doc_xml.getAttribute("name")
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 25, Issue 19
********************************************