Sandro Bonazzola has uploaded a new change for review.

Change subject: error handling: handle invalid host
......................................................................

error handling: handle invalid host

previously if an invalid host was specified an error like

ERROR: 'NoneType' object is not iterable

was printed.
Now a more explanatory error is showed:

ERROR: Unable to connect to REST API.  Message: The host name
"localhost" contained in the URL doesn't match any of the names in the
server certificate.
ERROR: Unable to get ISO domain data

Change-Id: I86ff1d2bcff923c76176554ae73beb47caa3d633
Bug-Url: https://bugzilla.redhat.com/1110756
Signed-off-by: Sandro Bonazzola <[email protected]>
(cherry picked from commit a6b721e0e9164dfadccd3961467d1b65c8994554)
---
M src/__main__.py
1 file changed, 7 insertions(+), 3 deletions(-)


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

diff --git a/src/__main__.py b/src/__main__.py
index 1399293..88ef120 100644
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -951,10 +951,14 @@
             )
         elif self.configuration.get('iso_domain'):
             # Discover the hostname and path from the ISO domain.
-            (id, domain_type, address, path) = \
-                self.get_host_and_path_from_ISO_domain(
-                    self.configuration.get('iso_domain')
+            iso_domain_data = self.get_host_and_path_from_ISO_domain(
+                self.configuration.get('iso_domain')
+            )
+            if iso_domain_data is None:
+                raise Exception(
+                    _('Unable to get ISO domain data')
                 )
+            (id, domain_type, address, path) = iso_domain_data
             remote_path = os.path.join(id, DEFAULT_IMAGES_DIR)
         elif self.configuration.get('nfs_server'):
             mnt = self.configuration.get('nfs_server')


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

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

Reply via email to