xm: fix up exception handling when spawning vnc viewer.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 4 Aug 2008 10:06:31 +0000 (11:06 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 4 Aug 2008 10:06:31 +0000 (11:06 +0100)
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/python/xen/xm/console.py

index 8abcb1d9a63a346a04e6577bc8d39a8a904366ca..0b83f1139dec50ef664fdadc5aa8365d1b1d808c 100644 (file)
@@ -40,14 +40,12 @@ class OurXenstoreConnection:
             while True:
                 result = self.handle.read('0', path)
                 if result is not None:
+                    signal.alarm(0)
                     return result
                 self.handle.read_watch()
-            self.handle.unwatch(path, watch)
-            signal.alarm(0)
-        except:
+        finally:
             signal.alarm(0)
             if watch is not None: self.handle.unwatch(path, watch)
-            raise
     def read_maybe(self, path):
         return self.handle.read('0', path)