Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: engine_page: Catch exception KeyError
......................................................................

engine_page: Catch exception KeyError

If VDSM is not ready to provide network data via 
getVdsCaps()['info']['networks']
and fail with KeyError we should throw an error message and not suck in the 
login.
Additionally, we should log as error in case of unexpected exception and block
users to login with raise call.

Change-Id: I4b7666c2020307c6119f96a2935684bc268e459b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1198029
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
---
M src/engine_page.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node-plugin-vdsm 
refs/changes/28/38428/1

diff --git a/src/engine_page.py b/src/engine_page.py
index 97a6838..719c246 100644
--- a/src/engine_page.py
+++ b/src/engine_page.py
@@ -118,12 +118,14 @@
         elif err.errno == errno.ENETUNREACH:
             LOGGER.debug("Network is unreachable to reach VDSM", exc_info=True)
         else:
-            raise
+            LOGGER.error("Catching exception:", exc_info=True)
+    except KeyError as err:
+        LOGGER.error("Cannot collect network data!", exc_info=True)
     except Exception as err:
         if 'No permission to read file:' in str(err):
             LOGGER.debug("pem files not available yet!", exc_info=True)
         else:
-            raise
+            LOGGER.error("Catching exception:", exc_info=True)
 
     if cfg["server"] is not None and validate_server(cfg["server"]):
         cfg["server"], cfg["port"] = cfg["server"].split(":")


-- 
To view, visit https://gerrit.ovirt.org/38428
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b7666c2020307c6119f96a2935684bc268e459b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node-plugin-vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to