[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix handling of devid_end when devid is an integer, but not present as a device.



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 84cf3d018bea75812fe152ce58166aa34ebe505b
# Parent  28a117c5ea94ef73c01cd46c6f87c576f1580c83
Fix handling of devid_end when devid is an integer, but not present as a device.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 28a117c5ea94 -r 84cf3d018bea tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py     Fri Nov 25 11:19:09 2005
+++ b/tools/python/xen/xend/server/blkif.py     Fri Nov 25 17:05:45 2005
@@ -93,10 +93,11 @@
         try:
             DevController.destroyDevice(self, int(devid))
         except ValueError:
-            devid_end = devid.split('/')[-1]
+            devid_end = type(devid) is str and devid.split('/')[-1] or None
+
             for i in self.deviceIDs():
                 d = self.readBackend(i, 'dev')
-                if d == devid or d == devid_end:
+                if d == devid or (devid_end and d == devid_end):
                     DevController.destroyDevice(self, i)
                     return
             raise VmError("Device %s not connected" % devid)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.