If activating disks fails for some reason, the watcher didn't
catch the exception. With this patch it's caught and logged.

Signed-off-by: Michael Hanselmann <[email protected]>
---
 daemons/ganeti-watcher |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/daemons/ganeti-watcher b/daemons/ganeti-watcher
index 4f8eb93..32c3ac4 100755
--- a/daemons/ganeti-watcher
+++ b/daemons/ganeti-watcher
@@ -440,7 +440,10 @@ class Watcher(object):
            for name in offline_disk_instances]
     job_id = cli.SendJob(job, cl=client)
 
-    cli.PollJob(job_id, cl=client, feedback_fn=logging.debug)
+    try:
+      cli.PollJob(job_id, cl=client, feedback_fn=logging.debug)
+    except Exception: # pylint: disable-msg=W0703
+      logging.exception("Error while activating disks")
 
 
 def ParseOptions():
-- 
1.6.6

Reply via email to