Change in vdsm[master]: Enhance output of vdsm-tool

ybronhei at redhat.com ybronhei at redhat.com
Sun Mar 16 08:31:55 UTC 2014


Yaniv Bronhaim has uploaded a new change for review.

Change subject: Enhance output of vdsm-tool
......................................................................

Enhance output of vdsm-tool

* Print output from vdsm-tool without traceback
* add operation prefix for each success\failure print in
  libvirt_configure

Change-Id: If89b605550f141fe2b7ab273c5824f0aa3a2e6e1
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1076371
---
M lib/vdsm/tool/libvirt_configure.sh.in
M vdsm-tool/vdsm-tool
2 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/25767/1

diff --git a/lib/vdsm/tool/libvirt_configure.sh.in b/lib/vdsm/tool/libvirt_configure.sh.in
index eacb37c..0716181 100755
--- a/lib/vdsm/tool/libvirt_configure.sh.in
+++ b/lib/vdsm/tool/libvirt_configure.sh.in
@@ -62,7 +62,7 @@
 
     local ssl=`"${GETCONFITEM}" "${VDSM_CONF_FILE}" vars ssl true | tr A-Z a-z`
     if [ -z "${ssl}" ]; then
-        echo 'FAILED: Could not read SSL configuration' 1>&2
+        echo 'VALIDATE FAILED: Could not read SSL configuration' 1>&2
         return 3
     fi
 
@@ -74,10 +74,10 @@
         if [ "${listen_tcp}" != "1" -a \
              "${auth_tcp}" != '"none"' -a \
              "${spice_tls}" != "0" ]; then
-            echo "SUCCESS: ssl configured to true. No conflicts"
+            echo "VALIDATE SUCCESS: ssl configured to true. No conflicts"
             return 0
         else
-            echo "FAILED: conflicting vdsm and libvirt-qemu tls configuration."
+            echo "VALIDATE FAILED: conflicting vdsm and libvirt-qemu tls configuration."
             echo "vdsm.conf with ssl=True requires the following changed: "
             echo "libvirtd.conf: listen_tcp=0, auth_tcp=\"sasl\", "
             echo "qemu.conf: spice_tls=1."
@@ -89,10 +89,10 @@
         if [ "${listen_tcp}" = "1" -a \
              "${auth_tcp}" = '"none"' -a \
              "${spice_tls}" = "0" ]; then
-            echo "SUCCESS: ssl configured to false. No conflicts."
+            echo "VALIDATE SUCCESS: ssl configured to false. No conflicts."
             return 0
         else
-            echo "FAILED: conflicting vdsm and libvirt-qemu tls configuration."
+            echo "VALIDATE FAILED: conflicting vdsm and libvirt-qemu tls configuration."
             echo "vdsm.conf with ssl=False requires the following changed: "
             echo "libvirtd.conf: listen_tcp=1, auth_tcp=\"none\", "
             echo "qemu.conf: spice_tls=0."
@@ -197,7 +197,7 @@
     local ts=/etc/pki/vdsm
     local ssl=`"${GETCONFITEM}" "${VDSM_CONF_FILE}" vars ssl true | tr A-Z a-z`
     if [ "${ssl}" = '' ]; then
-        echo 'FAILED: Could not read configuration' 1>&2
+        echo 'CONFIGURE FAILED: Could not read configuration' 1>&2
         return 3
     fi
 
diff --git a/vdsm-tool/vdsm-tool b/vdsm-tool/vdsm-tool
index 8bdf1bc..6bf8400 100755
--- a/vdsm-tool/vdsm-tool
+++ b/vdsm-tool/vdsm-tool
@@ -149,8 +149,8 @@
 
     try:
         return tool_command[cmd]["command"](*args[1:])
-    except Exception:
-        traceback.print_exc(file=sys.stderr)
+    except Exception as e:
+        print 'FAILURE: %s' % (e, )
         return 1
 
 if __name__ == "__main__":


-- 
To view, visit http://gerrit.ovirt.org/25767
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If89b605550f141fe2b7ab273c5824f0aa3a2e6e1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>


More information about the vdsm-patches mailing list