This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
master - config: fix objdb2xml filtering
- From: "Fabio M. Di Nitto" <fabbione at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Fri, 8 Aug 2008 13:56:26 +0000 (UTC)
- Subject: master - config: fix objdb2xml filtering
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d748a27ae6b1d6385d9003828185e5abdcb47d13
Commit: d748a27ae6b1d6385d9003828185e5abdcb47d13
Parent: 807f68e240762b223a0db57c4ca95f2a3c45245f
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Fri Aug 8 15:53:36 2008 +0200
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Fri Aug 8 15:53:36 2008 +0200
config: fix objdb2xml filtering
ais/corosync has a set of extra information on the toplevel
tree that includes <service service_id="" handle=""
that contains values for service_id and handle that cannot
be converted into XML data.
We were filtering for <service to avoid importing non-compliant data
but that was catching also /cluster/rm/service making it impossible
to use rgmanager.
Change the filter to match explicitly for service_id and handle.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
config/libs/libccsconfdb/libccs.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c
index dd71d36..1dcca62 100644
--- a/config/libs/libccsconfdb/libccs.c
+++ b/config/libs/libccsconfdb/libccs.c
@@ -84,6 +84,12 @@ static int dump_objdb_buff(confdb_handle_t dump_handle, unsigned int parent_obje
key_value, &key_value_len)) == SA_AIS_OK) {
key_name[key_name_len] = '\0';
key_value[key_value_len] = '\0';
+
+ if (!strncmp(key_name, "service_id", key_name_len))
+ continue;
+ if (!strncmp(key_name, "handle", key_name_len))
+ continue;
+
snprintf(temp, PATH_MAX - 1, " %s=\"%s\"", key_name, key_value);
add_to_buffer(temp, buffer, size);
}
@@ -112,8 +118,6 @@ static int dump_objdb_buff(confdb_handle_t dump_handle, unsigned int parent_obje
/* we need to skip the top level services because they have invalid
* xml chars */
- if(!strncmp(object_name, "service", object_name_len))
- continue;
snprintf(temp, PATH_MAX - 1, "<%s", object_name);
add_to_buffer(temp, buffer, size);