FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 12-05-2007, 03:46 PM
 
Default conga/ricci/modules/cluster/clumon/src/daemon ...

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe@sourceware.org 2007-12-05 16:46:16

Modified files:
ricci/modules/cluster/clumon/src/daemon: Monitor.cpp

Log message:
Still return cluster.conf info when cman isn't running

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp.diff?cvsroot=cluster&r1=1.20&r2=1.21

--- conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp 2007/11/21 17:41:21 1.20
+++ conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp 2007/12/05 16:46:16 1.21
@@ -80,8 +80,8 @@
msg_arrived(my_nodename, msg);
_cluster = merge_data(clustername);
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
- } catch ( ... ) {}
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
+ } catch (...) { }
}

void
@@ -110,7 +110,7 @@
_cluster = merge_data(clustername);
}
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
MutexLocker l(_mutex);
_cluster = counting_auto_ptr<Cluster>();
} catch ( ... ) {
@@ -153,9 +153,9 @@
try {
return cluster2xml(*_cluster) + "
";
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
return def;
- } catch ( ... ) {
+ } catch (...) {
return def;
}
}
@@ -192,7 +192,7 @@
}
}
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
} catch ( ... ) {}
}

@@ -221,61 +221,69 @@

try {
cluster.set_attr("minQuorum", probe_quorum());
- } catch ( ... ) {}
+ } catch (...) {}

cluster.set_attr("cluster_version", _cl_version);

- // insert current node info
- const vector<String> clustered_nodes = this->clustered_nodes();
- for (list<XMLObject>::const_iterator
- iter = cluster.children().begin() ;
- iter != cluster.children().end() ;
- iter++)
- {
- XMLObject& kid = (XMLObject&) *iter;
- if (kid.tag() == "node") {
- String name(kid.get_attr("name"));
- if (name == nodename) {
- // insert info about this node -> self
- kid.set_attr("uptime", uptime());
- }
+ try {
+ // insert current node info
+ const vector<String> clustered_nodes = this->clustered_nodes();
+ for (list<XMLObject>::const_iterator
+ iter = cluster.children().begin() ;
+ iter != cluster.children().end() ;
+ iter++)
+ {
+ XMLObject& kid = (XMLObject&) *iter;
+ if (kid.tag() == "node") {
+ String name(kid.get_attr("name"));
+ if (name == nodename) {
+ // insert info about this node -> self
+ kid.set_attr("uptime", uptime());
+ }

- if (find(clustered_nodes.begin(), clustered_nodes.end(), name) !=
- clustered_nodes.end())
- {
- kid.set_attr("online", "true");
- kid.set_attr("clustered", "true");
+ if (find(clustered_nodes.begin(), clustered_nodes.end(), name) !=
+ clustered_nodes.end())
+ {
+ kid.set_attr("online", "true");
+ kid.set_attr("clustered", "true");
+ }
}
}
- }
+ } catch (String e) {
+ log(String(__FILE__) + ":" + __LINE__ + ": caught exception: " + e, LogCommunicator);
+ } catch (...) { }

// insert current service info
- const vector<XMLObject> services_info = this->services_info();
- for (vector<XMLObject>::const_iterator
- iter_i = services_info.begin() ;
- iter_i != services_info.end() ;
- iter_i++)
- {
- const XMLObject& service = *iter_i;
- for (list<XMLObject>::const_iterator
- iter_c = cluster.children().begin() ;
- iter_c != cluster.children().end() ;
- iter_c++)
+ try {
+ const vector<XMLObject> services_info = this->services_info();
+ for (vector<XMLObject>::const_iterator
+ iter_i = services_info.begin() ;
+ iter_i != services_info.end() ;
+ iter_i++)
{
- XMLObject& kid = (XMLObject&) *iter_c;
- if (kid.tag() == "service") {
- if (kid.get_attr("name") == service.get_attr("name")) {
- for (map<String, String>::const_iterator
+ const XMLObject& service = *iter_i;
+ for (list<XMLObject>::const_iterator
+ iter_c = cluster.children().begin() ;
+ iter_c != cluster.children().end() ;
+ iter_c++)
+ {
+ XMLObject& kid = (XMLObject&) *iter_c;
+ if (kid.tag() == "service") {
+ if (kid.get_attr("name") == service.get_attr("name")) {
+ for (map<String, String>::const_iterator
iter = service.attrs().begin() ;
iter != service.attrs().end() ;
iter++)
- {
- kid.set_attr(iter->first, iter->second);
+ {
+ kid.set_attr(iter->first, iter->second);
+ }
}
}
}
}
- }
+ } catch (String e) {
+ log(String(__FILE__) + ":" + __LINE__ + ": caught exception: " + e, LogCommunicator);
+ } catch (...) { }

// ** return values **

@@ -289,6 +297,7 @@
vector<String>::iterator iter = find(nodes.begin(), nodes.end(), nodename);
if (iter != nodes.end())
nodes.erase(iter);
+
return nodes;
}

@@ -593,7 +602,7 @@
}
} catch (...) {
free(node_array);
- throw;
+ throw String("error getting node names");
}
free(node_array);
} else if (_cl_version == "4") {
@@ -789,7 +798,7 @@
}
}
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
} catch ( ... ) {}

return services;
@@ -893,7 +902,7 @@
merge_xmls(const XMLObject& what, const XMLObject& with)
{
if (what.tag() != with.tag())
- throw String("merge_xmls(): tag mismatch");
+ throw String("merge_xmls(): tag mismatch: "" + what.tag() + "" "" + with.tag() + """);

XMLObject new_xml(what.tag());
for (map<String, String>::const_iterator
 
Old 12-05-2007, 04:36 PM
 
Default conga/ricci/modules/cluster/clumon/src/daemon ...

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe@sourceware.org 2007-12-05 17:36:24

Modified files:
ricci/modules/cluster/clumon/src/daemon: Monitor.cpp

Log message:
Still return cluster.conf info when cman isn't running

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp.diff?cvsroot=cluster&only_with_tag=RHE L5&r1=1.10.2.6&r2=1.10.2.7

--- conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp 2007/11/21 17:42:36 1.10.2.6
+++ conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp 2007/12/05 17:36:24 1.10.2.7
@@ -80,8 +80,8 @@
msg_arrived(my_nodename, msg);
_cluster = merge_data(clustername);
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
- } catch ( ... ) {}
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
+ } catch (...) { }
}

void
@@ -110,7 +110,7 @@
_cluster = merge_data(clustername);
}
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
MutexLocker l(_mutex);
_cluster = counting_auto_ptr<Cluster>();
} catch ( ... ) {
@@ -153,9 +153,9 @@
try {
return cluster2xml(*_cluster) + "
";
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
return def;
- } catch ( ... ) {
+ } catch (...) {
return def;
}
}
@@ -192,7 +192,7 @@
}
}
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
} catch ( ... ) {}
}

@@ -221,61 +221,69 @@

try {
cluster.set_attr("minQuorum", probe_quorum());
- } catch ( ... ) {}
+ } catch (...) {}

cluster.set_attr("cluster_version", _cl_version);

- // insert current node info
- const vector<String> clustered_nodes = this->clustered_nodes();
- for (list<XMLObject>::const_iterator
- iter = cluster.children().begin() ;
- iter != cluster.children().end() ;
- iter++)
- {
- XMLObject& kid = (XMLObject&) *iter;
- if (kid.tag() == "node") {
- String name(kid.get_attr("name"));
- if (name == nodename) {
- // insert info about this node -> self
- kid.set_attr("uptime", uptime());
- }
+ try {
+ // insert current node info
+ const vector<String> clustered_nodes = this->clustered_nodes();
+ for (list<XMLObject>::const_iterator
+ iter = cluster.children().begin() ;
+ iter != cluster.children().end() ;
+ iter++)
+ {
+ XMLObject& kid = (XMLObject&) *iter;
+ if (kid.tag() == "node") {
+ String name(kid.get_attr("name"));
+ if (name == nodename) {
+ // insert info about this node -> self
+ kid.set_attr("uptime", uptime());
+ }

- if (find(clustered_nodes.begin(), clustered_nodes.end(), name) !=
- clustered_nodes.end())
- {
- kid.set_attr("online", "true");
- kid.set_attr("clustered", "true");
+ if (find(clustered_nodes.begin(), clustered_nodes.end(), name) !=
+ clustered_nodes.end())
+ {
+ kid.set_attr("online", "true");
+ kid.set_attr("clustered", "true");
+ }
}
}
- }
+ } catch (String e) {
+ log(String(__FILE__) + ":" + __LINE__ + ": caught exception: " + e, LogCommunicator);
+ } catch (...) { }

// insert current service info
- const vector<XMLObject> services_info = this->services_info();
- for (vector<XMLObject>::const_iterator
- iter_i = services_info.begin() ;
- iter_i != services_info.end() ;
- iter_i++)
- {
- const XMLObject& service = *iter_i;
- for (list<XMLObject>::const_iterator
- iter_c = cluster.children().begin() ;
- iter_c != cluster.children().end() ;
- iter_c++)
+ try {
+ const vector<XMLObject> services_info = this->services_info();
+ for (vector<XMLObject>::const_iterator
+ iter_i = services_info.begin() ;
+ iter_i != services_info.end() ;
+ iter_i++)
{
- XMLObject& kid = (XMLObject&) *iter_c;
- if (kid.tag() == "service") {
- if (kid.get_attr("name") == service.get_attr("name")) {
- for (map<String, String>::const_iterator
+ const XMLObject& service = *iter_i;
+ for (list<XMLObject>::const_iterator
+ iter_c = cluster.children().begin() ;
+ iter_c != cluster.children().end() ;
+ iter_c++)
+ {
+ XMLObject& kid = (XMLObject&) *iter_c;
+ if (kid.tag() == "service") {
+ if (kid.get_attr("name") == service.get_attr("name")) {
+ for (map<String, String>::const_iterator
iter = service.attrs().begin() ;
iter != service.attrs().end() ;
iter++)
- {
- kid.set_attr(iter->first, iter->second);
+ {
+ kid.set_attr(iter->first, iter->second);
+ }
}
}
}
}
- }
+ } catch (String e) {
+ log(String(__FILE__) + ":" + __LINE__ + ": caught exception: " + e, LogCommunicator);
+ } catch (...) { }

// ** return values **

@@ -289,6 +297,7 @@
vector<String>::iterator iter = find(nodes.begin(), nodes.end(), nodename);
if (iter != nodes.end())
nodes.erase(iter);
+
return nodes;
}

@@ -593,7 +602,7 @@
}
} catch (...) {
free(node_array);
- throw;
+ throw String("error getting node names");
}
free(node_array);
} else if (_cl_version == "4") {
@@ -789,7 +798,7 @@
}
}
} catch (String e) {
- log(__LINE__ + ": caught exception: " + e, LogCommunicator);
+ log(String(__FILE__) + ":" + __LINE__ + String(": caught exception: ") + e, LogCommunicator);
} catch ( ... ) {}

return services;
@@ -893,7 +902,7 @@
merge_xmls(const XMLObject& what, const XMLObject& with)
{
if (what.tag() != with.tag())
- throw String("merge_xmls(): tag mismatch");
+ throw String("merge_xmls(): tag mismatch: "" + what.tag() + "" "" + with.tag() + """);

XMLObject new_xml(what.tag());
for (map<String, String>::const_iterator
 
Old 05-12-2008, 03:15 PM
 
Default conga/ricci/modules/cluster/clumon/src/daemon ...

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe@sourceware.org 2008-05-12 15:15:23

Modified files:
ricci/modules/cluster/clumon/src/daemon: Monitor.cpp

Log message:
Fix type error

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp.diff?cvsroot=cluster&only_with_tag=RHE L5&r1=1.10.2.8&r2=1.10.2.9

--- conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp 2008/01/17 17:38:38 1.10.2.8
+++ conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp 2008/05/12 15:15:23 1.10.2.9
@@ -845,7 +845,7 @@
if (ch != NULL) {
int ret;
cman_version_t cman_version;
- char *clu_version = "";
+ String clu_version = "";

ret = cman_get_version(ch, &cman_version);
if (ret >= 0) {
 

Thread Tools




All times are GMT. The time now is 07:19 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org