Re: [PATCH] libvirt-guests: emit most messages to stderr

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

 



On Thu, Dec 31, 2015 at 04:53:54PM +1100, Michael Chapman wrote:
Some of the shell functions in this script (e.g. check_guests_shutdown)
produce output that is captured and processed by other parts of the
script. Any error messages from these shell functions must go to stderr,
not stdout.

Rather than trying to determine which messages are safe for stdout and
which are not (and maintaining this safety as the script is refactored),
simplify things by emitting all messages to stderr, except for the
output from gueststatus(), rh_status() and usage().


This is a good idea, but I just simply changing all outputs to stderr
seems wrong.  It doesn't matter for systemd systems, I guess, we output
everything to stdout currently and it goes to the logs anyway.  But for
other systems it might pollute the output with just informative
messages.  For example on my system I would see stderr but not stdout
(that goes to its logfile).  What is the reasoning behind this change?
Why can't we keep everything on stdout?

Signed-off-by: Michael Chapman <mike@xxxxxxxxxxxxxxxxx>
---
tools/libvirt-guests.sh.in | 94 +++++++++++++++++++++++-----------------------
1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index 7f74b85..80b1ec7 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -92,16 +92,16 @@ test_connect()

    i=${CONNECT_RETRIES}
    while [ $i -gt 0 ]; do
-        run_virsh "$uri" connect 2>/dev/null
+        run_virsh "$uri" connect >/dev/null 2>/dev/null

This could be fixed no matter how we decide to proceed with the rest.

Martin

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]