Simone Tiraboschi has uploaded a new change for review.

Change subject: Removing useless info line on specific excpetion
......................................................................

Removing useless info line on specific excpetion

On an exception it always says
INFO: Use the -h option to see usage.
but this is not always usefull

Change-Id: Ie4ff43555cb8105e27a83ef8dff5b7df42038ae1
Bug-Url: https://bugzilla.redhat.com/1023507
Signed-off-by: Simone Tiraboschi <[email protected]>
---
M src/__main__.py
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-iso-uploader 
refs/changes/13/27413/1

diff --git a/src/__main__.py b/src/__main__.py
index 509815b..55df9b5 100644
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -438,6 +438,12 @@
 
 class ISOUploader(object):
 
+    class NEISODomain(RuntimeError):
+        """"
+        This exception is raised when the user inputs a not existing ISO domain
+        """
+        pass
+
     def __init__(self, conf):
         self.api = None
         self.configuration = conf
@@ -637,7 +643,7 @@
             )
             return (sd_uuid, domain_type, address, path)
         else:
-            raise Exception(
+            raise self.NEISODomain(
                 _("An ISO storage domain with a name of %s was not found.") %
                 isodomain
             )
@@ -1430,7 +1436,11 @@
         isoup = ISOUploader(conf)
     except KeyboardInterrupt, k:
         print _("Exiting on user cancel.")
+    except ISOUploader.NEISODomain, e:
+        sys.exit(ExitCodes.CRITICAL)
     except Exception, e:
+        # FIXME: add better exceptions handling
+        logging.error("%s" % e)
         logging.error("%s" % e)
         logging.info(_("Use the -h option to see usage."))
         if conf and (conf.get("verbose")):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4ff43555cb8105e27a83ef8dff5b7df42038ae1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-iso-uploader
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to