[jenkins-ci PATCH 2/3] lcitool: push exception catching down into run method

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

 



Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 guests/lcitool | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 487b67d..2c86d07 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -690,12 +690,12 @@ class Application:
 
     def run(self):
         args = self._parser.parse_args()
-        args.func(args)
+        try:
+            args.func(args)
+        except Exception as err:
+            sys.stderr.write("{}: {}\n".format(sys.argv[0], err))
+            sys.exit(1)
 
 
 if __name__ == "__main__":
-    try:
-        Application().run()
-    except Exception as err:
-        sys.stderr.write("{}: {}\n".format(sys.argv[0], err))
-        sys.exit(1)
+    Application().run()
-- 
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