xenstore isn't even consistent in what happens on error
authorGreg Price <price@mit.edu>
Wed, 23 Jul 2008 05:10:21 +0000 (01:10 -0400)
committerGreg Price <price@mit.edu>
Wed, 23 Jul 2008 05:10:21 +0000 (01:10 -0400)
Usually when the VM is gone and xsc.ls('', '/vm/..uuid..') would
return empty, an xsc.ls('', '/vm/..uuid../start_time') returns None.
But sometimes it throws an xs.lowlevel.xs.Error, saying 22,
'Invalid argument', instead.

svn path=/trunk/packages/sipb-xen-remctl-auto/; revision=717

files/usr/sbin/sipb-xen-listvms

index 4daa953..79762fa 100755 (executable)
@@ -16,7 +16,7 @@ def live_vms():
     for domid in domids:
         try:
             name, data = get_dom(int(domid))
     for domid in domids:
         try:
             name, data = get_dom(int(domid))
-        except TypeError:
+        except (xs.Error, TypeError):
             continue # went down since we started
         if name.startswith('d_'):
             name = name[2:]
             continue # went down since we started
         if name.startswith('d_'):
             name = name[2:]