[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/ccs/ccs_tool editconf.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield sourceware org	2007-12-13 10:38:47

Modified files:
	ccs/ccs_tool   : editconf.c 

Log message:
	Fix altname option

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/editconf.c.diff?cvsroot=cluster&r1=1.11&r2=1.12

--- cluster/ccs/ccs_tool/editconf.c	2006/05/24 13:50:41	1.11
+++ cluster/ccs/ccs_tool/editconf.c	2007/12/13 10:38:42	1.12
@@ -417,7 +417,7 @@
 /* Print name=value pairs for a (n XML) node.
  * "ignore" is a string to ignore if present as a property (probably already printed on the main line)
  */
-static void print_properties(xmlNode *node, char *prefix, char *ignore, char *ignore2)
+static int print_properties(xmlNode *node, char *prefix, char *ignore, char *ignore2)
 {
 	xmlAttr *attr;
 	int done_prefix = 0;
@@ -440,6 +440,7 @@
 	}
 	if (done_prefix)
 		printf("\n");
+	return done_prefix;
 }
 
 /* Add name=value pairs from the commandline as properties to a node */
@@ -477,6 +478,7 @@
 {
 	xmlNode *clusternodes;
 	xmlNode *newnode;
+
 	xmlNode *newfence;
 	xmlNode *newfencemethod;
 	xmlNode *newfencedevice;
@@ -507,6 +509,15 @@
 	xmlSetProp(newnode, BAD_CAST "nodeid", BAD_CAST ninfo->nodeid);
 	xmlAddChild(clusternodes, newnode);
 
+	if (ninfo->altname)
+	{
+		xmlNode *altnode;
+
+		altnode = xmlNewNode(NULL, BAD_CAST "altname");
+		xmlSetProp(altnode, BAD_CAST "name", BAD_CAST ninfo->altname);
+		xmlAddChild(newnode, altnode);
+	}
+
 	/* Add the fence attributes */
 	newfence = xmlNewNode(NULL, BAD_CAST "fence");
 	newfencemethod = xmlNewNode(NULL, BAD_CAST "method");
@@ -975,6 +986,13 @@
 			       ftype?ftype:(xmlChar *)"");
 			if (verbose)
 			{
+				xmlNode *a = findnode(cur_node, "altname");
+				if (a)
+				{
+					printf(" altname %s=%s", "name", xmlGetProp(a, BAD_CAST "name"));
+					if (!print_properties(a, "","",""))
+						printf("\n");
+				}
 				print_properties(cur_node, "  Node properties: ", "votes", "nodeid");
 				print_properties(fencenode, "  Fence properties: ", "agent", "");
 			}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]