[libvirt] [PATCH sandbox 07/24] image: don't assume ValueError has a multi-line message

Daniel P. Berrange berrange at redhat.com
Fri Jul 15 13:07:59 UTC 2016


Just print out the value error text directly, instead of
trying to interpret it as a multi-line message.

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 libvirt-sandbox/image/cli.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libvirt-sandbox/image/cli.py b/libvirt-sandbox/image/cli.py
index a2e0bf1..b0d864f 100644
--- a/libvirt-sandbox/image/cli.py
+++ b/libvirt-sandbox/image/cli.py
@@ -240,9 +240,7 @@ def main():
         except KeyboardInterrupt, e:
             sys.exit(0)
         except ValueError, e:
-            for line in e:
-                for l in line:
-                    sys.stderr.write("%s: %s\n" % (sys.argv[0], l))
+            sys.stderr.write("%s: %s\n" % (sys.argv[0], e))
             sys.stderr.flush()
             sys.exit(1)
         except IOError, e:
-- 
2.7.4




More information about the libvir-list mailing list