Change in vdsm[master]: dump-volume-chains: Nicer output when no volumes found

nsoffer at redhat.com nsoffer at redhat.com
Mon Apr 13 19:47:26 UTC 2015


Nir Soffer has uploaded a new change for review.

Change subject: dump-volume-chains: Nicer output when no volumes found
......................................................................

dump-volume-chains: Nicer output when no volumes found

When no volumes found, print clear message instead of title and no
output:

    $ vdsm-tool dump-volume-chains ce362d37-ba2f-47c4-b46c-d71ee24019a8

             (no images found)

Change-Id: I65cc0def2b17155e361271c80050cd098678c392
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M lib/vdsm/tool/dump_volume_chains.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/39813/1

diff --git a/lib/vdsm/tool/dump_volume_chains.py b/lib/vdsm/tool/dump_volume_chains.py
index 6c5b8d4..25dd34f 100644
--- a/lib/vdsm/tool/dump_volume_chains.py
+++ b/lib/vdsm/tool/dump_volume_chains.py
@@ -202,6 +202,11 @@
 
 
 def _print_volume_chains(image_chains, volumes_info):
+    if not image_chains:
+        print()
+        _print_line("(no images found)")
+        print()
+        return
     print()
     print('Images volume chains (base volume first)')
     for img_uuid, vol_chain in image_chains.iteritems():


-- 
To view, visit https://gerrit.ovirt.org/39813
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65cc0def2b17155e361271c80050cd098678c392
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list