Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[PATCH] RA dev guide: ocf_run: replace -v with -q

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


tserong at suse

Aug 11, 2011, 6:39 AM

Post #1 of 1 (238 views)
Permalink
[PATCH] RA dev guide: ocf_run: replace -v with -q

# HG changeset patch
# User Tim Serong <tserong [at] suse>
# Date 1313069842 -36000
# Node ID 1949ea5878aa58466be5883484a3c91dbdbdc57e
# Parent 1caec681e0a823874c3185b8385e70c4a29a126f
RA dev guide: ocf_run: replace -v with -q

diff -r 1caec681e0a8 -r 1949ea5878aa dev-guides/ra-dev-guide.txt
--- a/dev-guides/ra-dev-guide.txt Wed Feb 23 14:02:44 2011 +0100
+++ b/dev-guides/ra-dev-guide.txt Thu Aug 11 23:37:22 2011 +1000
@@ -1204,17 +1204,18 @@ With the command specified above, the re
+frobnicate --spam=eggs+ and capture its output and
exit code. If the exit code is nonzero (indicating an error),
+ocf_run+ logs the command output with the +err+ logging severity, and
-the resource agent subsequently exits.
+the resource agent subsequently exits. If the exit code is zero
+(indicating success), any command couput will be logged with the +info+
+logging severity.

-If the resource agent wishes to capture the output of _both_ a
-successful and a failed command execution, it can use the +-v+ flag
-with +ocf_run+. In the example below, +ocf_run+ will log any output
-from the command with the +info+ severity if the command exit code is
-zero (indicating success), and with +err+ if it is nonzero.
+If the resource agent wishes to ignore the output of a successful
+command execution, it can use the +-q+ flag with +ocf_run+. In the
+example below, +ocf_run+ will only log output if the command exit code
+is nonzero.

[source,bash]
--------------------------------------------------------------------------
-ocf_run -v "frobnicate --spam=eggs" || exit $OCF_ERR_GENERIC
+ocf_run -q "frobnicate --spam=eggs" || exit $OCF_ERR_GENERIC
--------------------------------------------------------------------------

Finally, if the resource agent wants to log the output of a command
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.