[jenkins-ci PATCH] lcitool: Raise Error instead of Exception

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

 



This results in

  $ ./lcitool dockerfile dockerfile -x foo libvirt-debian-9 libvirt
  FROM debian:9
  ./lcitool: Unsupported architecture ppc64el

being printed on error, instead of the much nastier

  $ ./lcitool dockerfile dockerfile -x foo libvirt-debian-9 libvirt
  FROM debian:9
  Traceback (most recent call last):
    File "./lcitool", line 704, in <module>
      Application().run()
    File "./lcitool", line 699, in run
      args.func(args)
    File "./lcitool", line 643, in _action_dockerfile
      deb_arch = Util.native_arch_to_deb_arch(args.cross_arch)
    File "./lcitool", line 126, in native_arch_to_deb_arch
      raise Exception("Unsupported architecture {}".format(native_arch))
  Exception: Unsupported architecture foo

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 guests/lcitool | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index d6c8105..1119aaf 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -105,7 +105,7 @@ class Util:
             "x86_64": "x86_64-linux-gnu",
         }
         if native_arch not in archmap:
-            raise Exception("Unsupported architecture {}".format(native_arch))
+            raise Error("Unsupported architecture {}".format(native_arch))
         return archmap[native_arch]
 
     @staticmethod
@@ -123,7 +123,7 @@ class Util:
             "x86_64": "amd64",
         }
         if native_arch not in archmap:
-            raise Exception("Unsupported architecture {}".format(native_arch))
+            raise Error("Unsupported architecture {}".format(native_arch))
         return archmap[native_arch]
 
 
-- 
2.20.1

--
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]

  Powered by Linux