Martin Sivák has uploaded a new change for review.

Change subject: don't print stack trace when the ha broker is unreachable
......................................................................

don't print stack trace when the ha broker is unreachable

Change-Id: I02cfcd2a59ede40efaa0747a7dd3b9758ffb5270
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1150073
Signed-off-by: Jiri Moskovcak <jmosk...@redhat.com>
(cherry picked from commit 70f27b8852cf47449313f85b5b672e0a1c3e86bb)
---
M src/ovirt_hosted_engine_setup/vm_status.py
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/34/40734/1

diff --git a/src/ovirt_hosted_engine_setup/vm_status.py 
b/src/ovirt_hosted_engine_setup/vm_status.py
index a64ef0a..5a93793 100644
--- a/src/ovirt_hosted_engine_setup/vm_status.py
+++ b/src/ovirt_hosted_engine_setup/vm_status.py
@@ -27,6 +27,7 @@
 
 
 from ovirt_hosted_engine_ha.client import client
+from ovirt_hosted_engine_ha.lib.exceptions import BrokerConnectionError
 
 
 _ = lambda m: gettext.dgettext(message=m, domain='ovirt-hosted-engine-setup')
@@ -56,11 +57,15 @@
         ha_cli = client.HAClient()
         try:
             all_host_stats = ha_cli.get_all_host_stats()
-        except socket.error:
+        except (socket.error, BrokerConnectionError) as e:
+            sys.stderr.write(
+                _('{0}\n'.format(str(e)))
+            )
             sys.stderr.write(
                 _('Cannot connect to the HA daemon, please check the logs.\n')
             )
-            all_host_stats = {}
+            # there is no reason to continue if we can't connect to the daemon
+            return
 
         try:
             cluster_stats = ha_cli.get_all_stats(client.HAClient.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02cfcd2a59ede40efaa0747a7dd3b9758ffb5270
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: ovirt-hosted-engine-setup-1.2
Gerrit-Owner: Martin Sivák <msi...@redhat.com>
Gerrit-Reviewer: Jiří Moskovčák <jmosk...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to