conga ./clustermon.spec.in.in ricci/docs/clust ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-10-05 17:38:01
Modified files:
. : clustermon.spec.in.in
ricci/docs : cluster_api.html
ricci/modules/cluster: ClusterConf.cpp ClusterConf.h
ClusterModule.cpp ClusterStatus.cpp ClusterStatus.h
Log message:
cluster module: add purge_conf argument to stop_node() (bz202314)
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/docs/cluster_api.html.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterConf.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterConf.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterModule.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.cpp.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.h.diff?cvsroot=cluster&r1=1.3&r2=1.4
clustermon.spec.in.in +3 -0
@@ -194,6 +194,9 @@ %changelog +* Fri Oct 06 2006 Stanko Kupcevic <[email protected]> 0.8-18 +- Add purge_conf argument to stop_node modcluster call (bz202314) + * Wed Oct 04 2006 Stanko Kupcevic <[email protected]> 0.8-17 - Version bump
ricci/docs/cluster_api.html +6 -3
@@ -125,9 +125,12 @@ <P>Stop cluster infrastructure on this node (also, disable daemons' boot startup). <BR>It is not an error to stop already stopped node. </P> - <P>Input variables:<BR>- ???cluster_shutdown??? (boolean) ??? + <P>Input variables: + <BR>- ???cluster_shutdown??? (boolean) ??? optional, default ???false???, cluster is shutting down (don't - bounce services around)</P> + bounce services around) + <BR>- ???purge_conf??? (boolean) ??? + optional, default ???false???, delete cluster.conf; start_node() cannot be called any more, without calling set_cluster.conf() first <P>No output variables. </P> <P>On failure:<BR>- No special errors defined, only generic ones
@@ -148,4 +151,4 @@ <P><BR><BR> </P> </BODY> -</HTML> +</HTML>
ricci/modules/cluster/ClusterConf.cpp +6 -0
@@ -123,6 +123,12 @@ } } +void +ClusterConf::purge_conf() +{ + unlink(CLUSTER_CONF_PATH.c_str()); +} + bool ClusterConf::is_gulm(const XMLObject& cluster_conf) {
ricci/modules/cluster/ClusterConf.h +1 -0
@@ -33,6 +33,7 @@static XMLObject get (); static void set(const XMLObject& xml, bool propagate=true); +static void purge_conf (); static bool is_gulm(const XMLObject& cluster_conf); static bool is_cman(const XMLObject& cluster_conf);
ricci/modules/cluster/ClusterModule.cpp +6 -1
@@ -224,15 +224,20 @@ stop_node(const VarMap& args) { bool cluster_shutdown = false; + bool purge_conf = false; try { VarMap::const_iterator iter = args.find("cluster_shutdown"); if (iter != args.end()) cluster_shutdown = iter->second.get_bool(); + iter = args.find("purge_conf"); + if (iter != args.end()) + purge_conf = iter->second.get_bool(); } catch ( String e ) { throw APIerror(e); } - Cluster::stop_node(cluster_shutdown); + Cluster::stop_node(cluster_shutdown, + purge_conf); VarMap ret; return ret;
ricci/modules/cluster/ClusterStatus.cpp +9 -3
@@ -111,11 +111,12 @@ void Cluster::start_node(bool cluster_startup) { + XMLObject cluster_conf(ClusterConf::get()); // bailout if cluster.conf not present XMLObject stat = status(); if (stat.get_attr("cluster_version") == "4") { - XMLObject cluster_conf(ClusterConf::get()); run_initd("ccsd", true, false); + cluster_conf = ClusterConf::get(); // ccsd should bring newest cluster.conf if (ClusterConf::is_cman(cluster_conf)) try { run_initd("cman", true, true);
@@ -192,7 +193,7 @@ } bool use_qdisk = false; - XMLObject cluster_conf(ClusterConf::get()); // ccsd should bring newest cluster.conf + cluster_conf = ClusterConf::get(); // ccsd should bring newest cluster.conf for (list<XMLObject>::const_iterator iter = cluster_conf.children().begin(); iter != cluster_conf.children().end(); iter++)
@@ -223,7 +224,8 @@ } void -Cluster::stop_node(bool cluster_shutdown) +Cluster::stop_node(bool cluster_shutdown, + bool purge_conf) { XMLObject stat = status();
@@ -279,6 +281,10 @@ } else { throw String("unsupported cluster version ") + stat.get_attr("cluster_version"); } + + if (purge_conf) { + ClusterConf::purge_conf(); + } }
ricci/modules/cluster/ClusterStatus.h +2 -1
@@ -33,7 +33,8 @@static XMLObject status (); static void start_node(bool cluster_startup = false); - static void stop_node(bool cluster_shutdown = false); + static void stop_node(bool cluster_shutdown = false, + bool purge_conf = false); };