[Ocfs2-tools-devel] [PATCH 13/25] o2cb: Add ops list-clusters, list-cluster, list-nodes and list-heartbeats

Joel Becker Joel.Becker at oracle.com
Wed Jun 23 19:58:43 PDT 2010


On Wed, Jun 23, 2010 at 11:44:23AM -0700, Sunil Mushran wrote:
> +	if (oneline) {
> +		verbosef(VL_OUT, "heartbeat:\n");
> +		format = "  %s\n";

	This is two lines, not one.  If you're concerned about how
list-cluster would work, your way:

------------------------------------------------
heartbeat:
  aaaaaaaaaaaaaaaaaaaaaaaaaa
  bbbbbbbbbbbbbbbbbbbbbbbbbb
node:
  1, node1, 10.0.0.1:7777
  2, node2, 10.0.0.2:7777
------------------------------------------------

is a lot harder to parse than just prefixing the lines:

------------------------------------------------
heartbeat: aaaaaaaaaaaaaaaaaaaaaaaaaa
heartbeat: bbbbbbbbbbbbbbbbbbbbbbbbbb
node: 1, node1, 10.0.0.1:7777
node: 2, node2, 10.0.0.2:7777
------------------------------------------------

In fact, we don't allow spaces, lose the commas:

------------------------------------------------
heartbeat: aaaaaaaaaaaaaaaaaaaaaaaaaa
heartbeat: bbbbbbbbbbbbbbbbbbbbbbbbbb
node: 1 node1 10.0.0.1:7777
node: 2 node2 10.0.0.2:7777
------------------------------------------------

	Now awk(1) loves parsing our onelines.

Joel

-- 

"Up and down that road in our worn out shoes,
 Talking bout good things and singing the blues."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list