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: linux-ha by alan from
([email protected])
2. Linux-HA CVS: mgmt by zhenh from
([email protected])
3. Linux-HA CVS: include by zhenh from
([email protected])
4. Linux-HA CVS: mgmt by zhenh from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Wed, 21 Dec 2005 23:21:03 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by alan from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : alan
Host :
Module : linux-ha
Dir : linux-ha
Modified Files:
heartbeat.spec.in
Log Message:
Put in something which will break make rpm if you enable the mgmt daemons
at least until we figure out how to force automake to install a python script...
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat.spec.in,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -3 -r1.153 -r1.154
--- heartbeat.spec.in 21 Dec 2005 20:41:47 -0000 1.153
+++ heartbeat.spec.in 22 Dec 2005 06:21:03 -0000 1.154
@@ -1,4 +1,4 @@
-# $Id: heartbeat.spec.in,v 1.153 2005/12/21 20:41:47 alan Exp $
+# $Id: heartbeat.spec.in,v 1.154 2005/12/22 06:21:03 alan Exp $
# Workaround for a change in RPM 4.1.x; needs proper fixing soon!
##%define _unpackaged_files_terminate_build 0
@@ -1056,6 +1056,7 @@
@libdir@/libmgmtclient.*
@libdir@/libmgmtcommon.*
@libdir@/libmgmttls.*
+ @libdir@/pymgmt.py
/etc/pam.d/mgmtd
/usr/share/locale/zh_CN/LC_MESSAGES/haclient.zh_CN.mo
%endif
------------------------------
Message: 2
Date: Thu, 22 Dec 2005 00:21:19 -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:
add support for clean up unmanaged resources. copy some code from crm_resource
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.py.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- haclient.py.in 21 Dec 2005 08:56:01 -0000 1.7
+++ haclient.py.in 22 Dec 2005 07:21:18 -0000 1.8
@@ -1117,8 +1117,7 @@
self.set_action_sensitive('delrsc',
manager.connected
- and self.cur_type in
[_("native"),_("group"),_("clone"),_("place"),_("order"),_("colocation"),_("master")]
- and self.cur_status != _("unmanaged"))
+ and self.cur_type in
[_("native"),_("group"),_("clone"),_("place"),_("order"),_("colocation"),_("master")])
# functions
def update(self) :
self.tree.update()
@@ -1227,9 +1226,13 @@
manager.update_constraint("rsc_colocation",
colocation)
def on_del_item(self, action) :
- if confirmbox(_("Delete") + self.cur_type + " " + self.cur_name
+ "?"):
+ if confirmbox(_("Delete") + " "+self.cur_type + " " +
self.cur_name + "?"):
if self.cur_type in
[_("native"),_("group"),_("clone"),_("master")] :
- manager.do_cmd("del_rsc\n"+self.cur_name)
+ if string.find(self.cur_status, _("unmanaged"))
!= -1 :
+ hostname =
manager.do_cmd("rsc_running_on\n%s"%self.cur_name)
+
manager.do_cmd("cleanup_rsc\n"+hostname[0] + "\n" + self.cur_name)
+ else :
+
manager.do_cmd("del_rsc\n"+self.cur_name)
elif self.cur_type == _("place") :
manager.do_cmd("del_co\nrsc_location\n"+self.cur_name)
elif self.cur_type == _("order") :
------------------------------
Message: 3
Date: Thu, 22 Dec 2005 00:21:19 -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:
add support for clean up unmanaged resources. copy some code from crm_resource
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/mgmt/mgmt_common.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- mgmt_common.h 9 Dec 2005 09:42:22 -0000 1.2
+++ mgmt_common.h 22 Dec 2005 07:21:18 -0000 1.3
@@ -352,6 +352,18 @@
/*
description:
+ clean up a unmanaged resource
+format:
+ MSG_CLEANUP_RSC hostname resource
+return:
+ MSG_OK
+or
+ MSG_FAIL
+*/
+#define MSG_CLEANUP_RSC "cleanup_rsc"
+
+/*
+description:
return the params of a given resource
format:
MSG_RSC_PARAMS resource
------------------------------
Message: 4
Date: Thu, 22 Dec 2005 00:21:19 -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_crm.c
Log Message:
add support for clean up unmanaged resources. copy some code from crm_resource
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- mgmt_crm.c 21 Dec 2005 06:00:22 -0000 1.5
+++ mgmt_crm.c 22 Dec 2005 07:21:18 -0000 1.6
@@ -50,6 +50,7 @@
static char* on_get_running_rsc(char* argv[], int argc);
static char* on_del_rsc(char* argv[], int argc);
+static char* on_cleanup_rsc(char* argv[], int argc);
static char* on_add_rsc(char* argv[], int argc);
static char* on_add_grp(char* argv[], int argc);
@@ -83,6 +84,8 @@
static int delete_object(const char* type, const char* entry, const char* id);
static GList* find_xml_node_list(crm_data_t *root, const char *search_path);
static pe_working_set_t get_data_set(void);
+static int refresh_lrm(IPC_Channel *crmd_channel, const char *host_uname);
+static int delete_lrm_rsc(IPC_Channel *crmd_channel, const char *host_uname,
const char *rsc_id);
#define GET_RESOURCE() if (argc != 2) {
\
return cl_strdup(MSG_FAIL);
\
@@ -201,6 +204,7 @@
reg_msg(MSG_RUNNING_RSC, on_get_running_rsc);
reg_msg(MSG_DEL_RSC, on_del_rsc);
+ reg_msg(MSG_CLEANUP_RSC, on_cleanup_rsc);
reg_msg(MSG_ADD_RSC, on_add_rsc);
reg_msg(MSG_ADD_GRP, on_add_grp);
@@ -461,6 +465,74 @@
return cl_strdup(MSG_OK);
}
+static int
+delete_lrm_rsc(IPC_Channel *crmd_channel, const char *host_uname, const char
*rsc_id)
+{
+ HA_Message *cmd = NULL;
+ crm_data_t *msg_data = NULL;
+ crm_data_t *rsc = NULL;
+ char our_pid[11];
+ char *key = NULL;
+
+ snprintf(our_pid, 10, "%d", getpid());
+ our_pid[10] = '\0';
+ key = crm_concat(client_name, our_pid, '-');
+
+
+ msg_data = create_xml_node(NULL, XML_GRAPH_TAG_RSC_OP);
+ crm_xml_add(msg_data, XML_ATTR_TRANSITION_KEY, key);
+
+ rsc = create_xml_node(msg_data, XML_CIB_TAG_RESOURCE);
+ crm_xml_add(rsc, XML_ATTR_ID, rsc_id);
+
+ cmd = create_request(CRM_OP_LRM_DELETE, msg_data, host_uname,
+ CRM_SYSTEM_CRMD, client_name, our_pid);
+
+ free_xml(msg_data);
+ crm_free(key);
+
+ if(send_ipc_message(crmd_channel, cmd)) {
+ return 0;
+ }
+ return -1;
+}
+
+static int
+refresh_lrm(IPC_Channel *crmd_channel, const char *host_uname)
+{
+ HA_Message *cmd = NULL;
+ char our_pid[11];
+
+ snprintf(our_pid, 10, "%d", getpid());
+ our_pid[10] = '\0';
+
+ cmd = create_request(CRM_OP_LRM_REFRESH, NULL, host_uname,
+ CRM_SYSTEM_CRMD, client_name, our_pid);
+
+ if(send_ipc_message(crmd_channel, cmd)) {
+ return 0;
+ }
+ return -1;
+}
+
+char*
+on_cleanup_rsc(char* argv[], int argc)
+{
+ IPC_Channel *crmd_channel = NULL;
+ char our_pid[11];
+
+ snprintf(our_pid, 10, "%d", getpid());
+ our_pid[10] = '\0';
+
+ init_client_ipc_comms(CRM_SYSTEM_CRMD, NULL,
+ NULL, &crmd_channel);
+
+ send_hello_message(crmd_channel, our_pid, client_name, "0", "1");
+ delete_lrm_rsc(crmd_channel, argv[1], argv[2]);
+ refresh_lrm(crmd_channel, argv[1]);
+ return cl_strdup(MSG_OK);
+}
+
/*
0 cmd = "add_rsc"
1 cmd += "\n"+rsc["id"]
------------------------------
_______________________________________________
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 61
********************************************